Kevin Gill
Kevin Gill

Reputation: 427

Django migration - disable system checks

I upgraded from Django 1.7 to Django 1.9. I have a number of migrations. Since the upgrade I can no longer create a fresh database.

The problem is that "django manage.py migrate" runs checks. The checks import the application urls. These ultimately import code that looks up the database.

I can get the migration to work, by modifying the migrate.py script and adding this line (as per Django: skip system check when running custom command):

 requires_system_checks = False

Is there a standard/supported way to prevent the system checks via a command line parameter, or is there a way to know that I am running in a management command during the url loading so that I can exclude the web-serving parts of the system?

Upvotes: 8

Views: 3203

Answers (1)

Davit Tovmasyan
Davit Tovmasyan

Reputation: 3588

There is a way in the 3.0 version, there is a flag called --skip-checks which skips running system checks prior to running the command.

Upvotes: 4

Related Questions