-
-
Save voznik/5893a47f4b2caf3e28772616f86281d3 to your computer and use it in GitHub Desktop.
Change default port for django runserver
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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_ADDR="0.0.0.0" | |
runserver.DEFAULT_PORT="8080" | |
# ...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