Hi JK,
On Thursday 10 October 2013 15:16:41 JK Laiho wrote:
>
> I'm developing a Django site that will be served in production by
> nginx-proxied gunicorn. The site is mounted on a subpath, and the nginx
> config sets SCRIPT_NAME to /path to facilitate this.
>
> This arrangement works fine with gunicorn, which I've got set up in my
> Vagrant environment, but usually I like to use runserver or runserver_plus
> from django-extensions during development. From nginx's perspective, there
> is no difference, as both gunicorn and runserver serve at
127.0.0.1:8000.
> However, while the site mounts correctly to /path under gunicorn, this is
> not the case with runserver. I looked into why this is, and after some time
> spent in pdb discovered what looks to be the reason.
>
> [...]
>
> Should I file a ticket for this?
>
The "runserver" command is intended to be used as a front-facing server, and
not as a backend for an external server. While it may be used that way, this
use is not intended. The few days that have gone without any response for your
request are an indicator that there is little interest in this in the
community.
So, if this can be arranged with a trivial fix, such a fix may be accepted, but
if there's any cost involved (in complication and/or risk), the issue is very
likely to be wontfix'd; it is even possible that it will be wontfix'd on the
grounds that fixing it may encourage the use of runserver in production, which
we strongly recommend against.
You can write your own WSGIRequestHandler and use that instead of Django's, by
modifying the wsgi file (which is a project file). You can even inherit Django's
handler. If you need modifications in Django's handler in order to extend it
the way you want, that may be received more favorably then a straight attempt
to make runserver behave well behind nginx.
Hope this helps,
Shai.