Skip to content

Instantly share code, notes, and snippets.

@aubricus
Last active November 11, 2017 11:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aubricus/ae9577fbb44743fe7dfa453f51a3537a to your computer and use it in GitHub Desktop.
Save aubricus/ae9577fbb44743fe7dfa453f51a3537a to your computer and use it in GitHub Desktop.
django_extensions reset_db is incompatible with any .py file that accesses the database that's loaded during a `./manage.py` system checks cycle. This gist simply overrides the default `reset_db` command to disable these checks.
from django_extensions.management.commands.reset_db import Command as ResetDBCommand
class Command(ResetDBCommand):
requires_system_checks = False
help = "Override django-extensions reset_db and disable system_checks."
def handle(self, *args, **options):
self.stdout.write("Executing customized version of reset_db that disables system checks.")
super().handle(*args, **options)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment