Django entry record 2 django case django build django project

WBOY
Release: 2016-07-29 08:54:31
Original
1281 people have browsed it

1. Create an app, python manage.py startapp appname

2. Design the model, edit the model in the appname/ directory

3. Detect the modification of the model, python manage.py makemigrations appname

4. Automatically execute the database Migrate and synchronously manage the database structure, python manage.py sqlmigrate 0001

5. Create a data table of the newly defined model in the database python manage.py migrate

Steps to change the model:

  • Edit the models.py file, Change the model.
  • Run python manage.py makemigrations to generate migration files for model changes.
  • Run python manage.py migrate to apply database migration.

The above introduces Django entry record 2, including Django content. I hope it will be helpful to friends who are interested in PHP tutorials.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template