Skip to content

Instantly share code, notes, and snippets.

@mozz100
Last active June 13, 2021 02:57
Show Gist options
  • Save mozz100/6e00e70d911b000ff0e0 to your computer and use it in GitHub Desktop.
Save mozz100/6e00e70d911b000ff0e0 to your computer and use it in GitHub Desktop.
Change default port for django runserver
# Put this at <yourapp>/management/commands/runserver.py.
# Override the value of the constant coded into django...
import django.core.management.commands.runserver as runserver
runserver.DEFAULT_PORT="8197"
# ...and then just import its standard Command class.
# Then manage.py runserver behaves normally in all other regards.
from django.core.management.commands.runserver import Command
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment