1. Create Project
Method One: Use the command line to create the project. In the D-disk cmd execute the following command:
django-admin.py Startproject MyBlog
Method Two: Create the project using Pycharm. Drop location is D:\myblog
2. Create an App
Method One: Use the command line to create the app, in the D-Disk blog folder cmd execution command line creation.
Method Two: Create in pycharm with the terminal command line.
Python manage.py Startapp Blog
3. Introduction of documents
(1) mange.py is a project management tool in Django
(2) files in MyBlog (project):
Wsgi.py:WSGI is the Web Server Gateway Interface Server gateways interface. Is the interface between the Python app and the Web server. No need to move it.
Urls.py:URL configuration file. All the Addresses (pages) in the Django project need us to configure their URLs.
setting.py: The overall configuration file for the project. Includes databases, Web applications, time, and many other configurations.
Base_dir: The root directory of the project
Debug: When set to True, program exceptions are displayed on the front end, set to True when developing debugging, and set to False when actually produced.
Installed_apps: Installed applications, the application of their own development will be added in the future.
Middleware: Middleware, Django comes with a toolset.
Templites: Template. That is, HTML files.
DATABASES: Database configuration.
Language_code: Language.
Time_zone: Time zone.
Static_url: The address of the static file.
_init_.py: Declares the module's file, which is generally empty.
(3) files in the blog (APP)
Migrations: A module for data migration. Content is automatically generated by Django.
admin.py: The configuration file for the application's background management system.
app.py: Some configurations of the application.
models.py: The data table is created here.
test.py: Automated test module.
vies.py: The module in which the code executes the response. The primary location for code logic processing. Most of the code in the project is written here.
Django Learning Case One (blog): I. Create a project, APP