Home >Backend Development >PHP Tutorial >Django entry record 2, Django entry record_PHP tutorial

Django entry record 2, Django entry record_PHP tutorial

WBOY
WBOYOriginal
2016-07-12 08:55:03860browse

Django entry record 2, Django entry record

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

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

3. Detect model modifications, python manage.py makemigrations appname

4. Automatically perform database migration and manage the database structure synchronously, 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 to change the model.
  • Run python manage.py makemigrations to generate migration files for model changes.
  • Run python manage.py migrate to apply the database migration.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/1117388.htmlTechArticledjango entry record 2, django entry record 1. Create an app, python manage.py startapp appname 2. Design model , edit the model in the appname/ directory 3. Detect the modification of the model, python...
Statement:
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