简体   繁体   中英

Skip django migrate default table

I use django-admin startproject to create a new project, then use python manage.py migrate .

I find there are some tables will create by default. 在此处输入图像描述

I want migrate my tables only when I run python manage.py migrate . Is it possible to skip the default?

By default, INSTALLED_APPS contains django.contrib.admin and django.contrib.auth apps (along with few other apps). These apps are part of Django. These apps are optional, and can be removed if you do not need functionality they provide (See: Run django application without django.contrib.admin ).

python manage.py makemigrations will create the migrations files for all the changes to models in all the apps .
Andpython manage.py migrate will apply previously computed migrations to the database.

When you have multiple apps, use python manage.py makemigrations [app_name] , and python manage.py migrate [app_name] to limit these operations to specific app.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM