Opened 5 years ago

Last modified 5 years ago

#30634 closed Bug

"manage.py runserver" does not respect SCRIPT_NAME header — at Initial Version

Reported by: Oleg Kainov Owned by: nobody
Component: HTTP handling Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

  1. Configure local nginx to emulate prod-like environment (i.e. when Django is running in Docker) and app should be in subfolder
 location /myapp/ {
                proxy_pass http://127.0.0.1:8000/;

   #proxy_set_header X-Script-Name /myapp;
    proxy_set_header SCRIPT_NAME /myapp;

                include proxy_params;
}
  1. Run default Django app locally
    manage.py runserver
    
  2. Debug any request and inspect request.META
  3. Make sure request.METASCRIPT_NAME is empty

In the same time seems that running with uWSGI or something similar works. SO I assume the error is somewhere in manage.py runserver behavior

Background:
While I'm aware that runserver considered "insecure" and "slow", it doesn't really matter for me when I'm deploying small internal apps in my company (imagine ~10 users-app with <5 views). Since with manage.py I can run my app in "one click" and avoid hassle of separating static files serving and the main app, I would really like to keep it this way.

Change History (0)

Note: See TracTickets for help on using tickets.
Back to Top