Django-bootstrap First login Page __bootstrap

Source: Internet
Author: User
Tags install django pip install django
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.