Skip to content

Instantly share code, notes, and snippets.

@nguyenbathanh
Last active September 15, 2019 02:49
Show Gist options
  • Save nguyenbathanh/953c5eb2bcb6e50955adf970db463a53 to your computer and use it in GitHub Desktop.
Save nguyenbathanh/953c5eb2bcb6e50955adf970db463a53 to your computer and use it in GitHub Desktop.

Revisions

  1. nguyenbathanh revised this gist Sep 15, 2019. 1 changed file with 16 additions and 0 deletions.
    16 changes: 16 additions & 0 deletions run.py
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,19 @@
    # You need to put this under <app>/management/commands/run.py
    # where <app> is whatever appropriate app should have this command.
    # Then you can invoke it with ./manage.py run and you'll get something like:

    # Performing system checks...

    # SKIPPING SYSTEM CHECKS!

    # SKIPPING MIGRATION CHECKS!

    # September 15, 2019 - 02:42:06
    # Django version 2.2.5, using settings 'app.settings'
    # Starting development server at http://127.0.0.1:8000/
    # Quit the server with CONTROL-C.


    from django.core.management.commands.runserver import Command as RunServer

    class Command(RunServer):
  2. nguyenbathanh created this gist Sep 15, 2019.
    9 changes: 9 additions & 0 deletions run.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    from django.core.management.commands.runserver import Command as RunServer

    class Command(RunServer):

    def check(self, *args, **kwargs):
    self.stdout.write(self.style.WARNING("SKIPPING SYSTEM CHECKS!\n"))

    def check_migrations(self, *args, **kwargs):
    self.stdout.write(self.style.WARNING("SKIPPING MIGRATION CHECKS!\n"))