[Fixed]-Monkey patch Django runserver command

1👍

To modify runserver, you could create a custom management command. You should be able to subclass runserver and add the extra arguments.

You might find it easier to set an environment variable, rather than changing the runserver command. In your settings, you would do something like:

import os
env = os.getenv('ENV') or 'dev'

Then you would run the dev server with

ENV=dev python manage.py runserver

Leave a comment