One, request page
render_to_response (' login.html ')
For requesting a page, create a templates file in the corresponding views and files directory, and put login.html in it. Figure:
Add the corresponding path in the settings.py template_dirs :
Reference Two, django-bootstrap build
1. Install Django-bootstrap-static
Pip Install Django-bootstrap-static
After the installation is successful, a bootstrap directory is added to the Python/site-packages directory
Introduced in 2.settings.py
Installed_apps = (
' Django.contrib.auth ',
' django.contrib.contenttypes ', '
django.contrib.sessions ',
' django.contrib.sites ',
' django.contrib.messages ',
' django.contrib.staticfiles ',
# Uncomment The next line to enable the admin:
' django.contrib.admin ',
# uncomment the next line to enable admin Documentati On:
# ' Django.contrib.admindocs ',
* * ' bootstrap ', * *
3, change the reference path static
<link rel= "stylesheet" type= "Text/css" href= "Static/css/bootstrap.min.css"/>
4, and then you can quote the contents of the inside
Login.html Code:
<?xml version= "1.0" encoding= "UTF-8"?> <! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 strict//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" > < HTML xmlns= "http://www.w3.org/1999/xhtml" xml:lang= "en" lang= "en" >
Reference
Now can be happy to write it.