--
Ticket URL: <https://code.djangoproject.com/ticket/22722>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0
Comment:
It's not clear to me why you need this. `runserver` shouldn't be used in
production and I don't think we're going to add more features to it, but
I'll leave the ticket open in case you'd like to elaborate further.
--
Ticket URL: <https://code.djangoproject.com/ticket/22722#comment:1>
Comment (by kermit):
OK, yeah, I think I might not have been too clear. So,
[http://12factor.net/config the 12-factor app clause] is that on servers,
you should be able to control the relevant configuration using environment
variables, as it's easy to manage this using e.g. ansible, salt or the
heroku cli. The .env file is used on a local dev machine to not have to
set up these environment variables in your .bashrc for every project. This
is already supported by process launchers such as foreman and honcho
([https://honcho.readthedocs.org/en/latest/using_procfiles.html
#environment-files relevant honcho] and
[http://ddollar.github.io/foreman/#ENVIRONMENT foreman docs]), but while
developing we probably want to use ./manage.py runserver, as it auto-
refreshes on code changes. Now, I'm suggesting a -e <envfile> option (and
implicitly reading variables from a .env file if it's present) that would
set the relevant environment variables for the launched process, to be
able to keep the same workflow with runserver too.
--
Ticket URL: <https://code.djangoproject.com/ticket/22722#comment:2>
* component: Uncategorized => Core (Management commands)
* type: Uncategorized => New feature
Comment:
It makes sense, but couldn't you do something like add some logic in your
development settings file to parse and set the variables? It may not be
the most elegant solution, but I'm hesitant to add more logic to
`runserver` for this purpose.
In the long run, we've thought about replacing runserver with something
like gunicorn (#21978) since as a web framework, our focus shouldn't be on
building web servers.
I did notice that gunicorn has [http://gunicorn-
docs.readthedocs.org/en/latest/settings.html#raw-env an option for passing
environment variables] (although not reading them from a config, it
appears).
Anyway, that's just my 2 cents, we'll see what others think.
--
Ticket URL: <https://code.djangoproject.com/ticket/22722#comment:3>
Comment (by claudep):
I'd rather see this as a complementary Django application (subclassing
runserver). Not everyone adhere to the 12-factor app philosophy, and I'm
not fond of adding new code in Django each time a new trend is in the air
(no offense intended). I'm personally rather on the minimalist side of
things.
--
Ticket URL: <https://code.djangoproject.com/ticket/22722#comment:4>
* status: new => closed
* resolution: => wontfix
--
Ticket URL: <https://code.djangoproject.com/ticket/22722#comment:5>