Skip to content

Commit

Permalink
Subclass runserver command as runlocalserver
Browse files Browse the repository at this point in the history
  • Loading branch information
laurenbarker committed Apr 21, 2017
1 parent 6191a3b commit cc15ee1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
7 changes: 0 additions & 7 deletions manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
import os
import sys

import django

if os.environ.get('GEVENT') == '1':
from gevent import monkey
monkey.patch_all()
Expand 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)
6 changes: 6 additions & 0 deletions share/management/commands/runlocalserver.py
Original file line number Diff line number Diff line change
@@ -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"

0 comments on commit cc15ee1

Please sign in to comment.