Home Backend Development PHP Tutorial Django entry record 2 django case django build django project

Django entry record 2 django case django build django project

Jul 29, 2016 am 08:54 AM
django

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.

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

Hot Article Tags

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to check django version How to check django version Dec 01, 2023 pm 02:25 PM

How to check django version

Django vs. Flask: A comparative analysis of Python web frameworks Django vs. Flask: A comparative analysis of Python web frameworks Jan 19, 2024 am 08:36 AM

Django vs. Flask: A comparative analysis of Python web frameworks

Django Framework Pros and Cons: Everything You Need to Know Django Framework Pros and Cons: Everything You Need to Know Jan 19, 2024 am 09:09 AM

Django Framework Pros and Cons: Everything You Need to Know

How to check django version How to check django version Nov 30, 2023 pm 03:08 PM

How to check django version

How to upgrade Django version: steps and considerations How to upgrade Django version: steps and considerations Jan 19, 2024 am 10:16 AM

How to upgrade Django version: steps and considerations

What is the difference between django versions? What is the difference between django versions? Nov 20, 2023 pm 04:33 PM

What is the difference between django versions?

Is django front-end or back-end? Is django front-end or back-end? Nov 21, 2023 pm 02:36 PM

Is django front-end or back-end?

How to install django How to install django Dec 19, 2023 am 11:38 AM

How to install django

See all articles