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:
syncdb
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?
Yes, and this is fully documented; set the requires_system_checks
attribute to False in your Command subclass.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With