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 ......