5

I've added a custom management command to an application developed using Django 1.6.11. This command, let's call it initdb, performs a set of particualr actions:

  • Checks whenever a database and user from settings.py exist and if not create them, set appropriate character sets, grants access, etc.
  • Performs syncdb
  • Loads particular database dump

In other words, it's very handy for quick database initialization from total zero.

Now, I'm migrating to Django 1.8.5 and one thing I've noticed is that, before almost every command, Django automatically executes check command from new system check framework, which among other stuff checks if database/user form settings.py exist. That leads to a situation when I can't run my custom command because automatic check throws exceptions that there is no access to database (indeed, my custom command should create it).

Is there any way to force skipping automatic check that Django makes, at least in custom management command?

1 Answer 1

10

Yes, and this is fully documented; set the requires_system_checks attribute to False in your Command subclass.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.