diff --git a/manage.py b/manage.py index 0ed0f145d..c141c0db1 100755 --- a/manage.py +++ b/manage.py @@ -2,8 +2,6 @@ import os import sys -import django - if os.environ.get('GEVENT') == '1': from gevent import monkey monkey.patch_all() @@ -14,11 +12,6 @@ if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "project.settings") - # Override default port for `runserver` command - django.setup() - from django.core.management.commands.runserver import Command as runserver - runserver.default_port = "38000" - from django.core.management import execute_from_command_line execute_from_command_line(sys.argv) diff --git a/share/management/commands/runlocalserver.py b/share/management/commands/runlocalserver.py new file mode 100644 index 000000000..ce9c83e76 --- /dev/null +++ b/share/management/commands/runlocalserver.py @@ -0,0 +1,6 @@ +from django.contrib.staticfiles.management.commands.runserver import Command as RunserverCommand + + +class Command(RunserverCommand): + # Override default port for `runserver` command + default_port = "38000"