Skip to content

Commit cc15ee1

Browse files
committed
Subclass runserver command as runlocalserver
1 parent 6191a3b commit cc15ee1

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

manage.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
import os
33
import sys
44

5-
import django
6-
75
if os.environ.get('GEVENT') == '1':
86
from gevent import monkey
97
monkey.patch_all()
@@ -14,11 +12,6 @@
1412
if __name__ == "__main__":
1513
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "project.settings")
1614

17-
# Override default port for `runserver` command
18-
django.setup()
19-
from django.core.management.commands.runserver import Command as runserver
20-
runserver.default_port = "38000"
21-
2215
from django.core.management import execute_from_command_line
2316

2417
execute_from_command_line(sys.argv)
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
from django.contrib.staticfiles.management.commands.runserver import Command as RunserverCommand
2+
3+
4+
class Command(RunserverCommand):
5+
# Override default port for `runserver` command
6+
default_port = "38000"

0 commit comments

Comments
 (0)