It's hard to get a name! (Django first), django first

Source: Internet
Author: User

It's hard to get a name! (Django first), django first

This time we will implement a simple login registration function, and write the corresponding data into the database:

Before doing this, I have created two new tables in the database (of course, one table can also be used. register first and then log on ···)

Two data tables with a simple structure: sheet

Next we should do the right thing: Success

1. Compile the interface to be presented to the user (under the template directory): (this is the only way to develop artistic bacteria ..)

(# It looks messy to allocate an address with a url in the entire project, so I created a new url in the App Project)

2. Configure the global urls of the site:

After the logging configuration, the global URL can also use the resources under the App.

3. Configure the urls under the App:

4. View configuration under the App:

5. Start the service: Enter python manage. py runserver in terminal to start the service.

 

6. browser access:

 

When you click submit, the data will be written to the database. However, sometimes some annoying bugs may occur, but you can solve them with caution.

The logic is very simple, but every time I make a mistake, I am not saved ......

 

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.