1. Create a project f:\>django-admin.py Startproject csvt03
2. Switch directory F:\>CD csvt03
3. Create a project f:\csvt03>django-admin.py Startapp blog
4. configuration file sittings.py Add app let framework find
sittings.py metabase Parameters engine: Database type name: Database name (database to create) host and port Use default can not fill
5. Create the class employee, which is equivalent to creating the table employee in the CSVT database configured above (its parent class is models. Model),
Add Class Property name, which is the equivalent of adding a name field to the employee table, and specifying the maximum length of the field after the = number
6. Execute the Database synchronization command Python manage.py syncdb, at which point the Employee table and the Name field we added above will be created into the database. Table name is Blog_employee
The database Synchronization command checks each project's database file for modifications and does not perform any action if no modifications are performed.
7. Display the database contents on the page, configure urls.py to create the access path, and specify the method to receive the access path
8. urls.py Specifies that the index method in views.py receives the URL request, and then adds the implementation of the method to the views.py file (which is empty) . The Employee.objects.all () method returns all the contents of the employee table, the method
9. The index method in views.py returns a file for the request index.html, the file must be created by itself, the file and the default location is templates directory, the directory is also created by itself, the index.html code is as follows, the inside of the tag receives the value of the function passed in.
Django uses the project creation process for the database