Django is an open source web application framework written in Python.
The development steps are as follows.
1. Installing Django
pip install django
2. Creating a django project
django-admin startproject mysite
You can also use pycharm to create it. If you use pycharm to create it, remember to delete the DIRS templates in it.
3. Create and register the app
python startapp app01
If you don't perform step 3, you can't create a table in the database when you write a class under the app.
4. Configure static file paths and template paths
5. Configuring database-related operations
(1) Installation of third-party libraries
pip install mysqlclient
(2) Go to MySQL to create a database
(3) Configure the files in the database.
(4) Write the code to create the table in the app under the
(5) Execute the two commands, you can create the corresponding table in the database through the class in.
python makemigrationspython migrate
6. Relationship between in, route, create url and view functions
7. In the, view function, write the business logic
8. In the templates directory, write the HTML template
summarize
That's all for this post, I hope it was helpful and I hope you'll check back for more from me!