FORCE_SCRIPT_NAME does not work with dev server
|Reported by:||ElliottM||Owned by:||nobody|
|Cc:||flosch, nkryptic||Triage Stage:||Accepted|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
In order to ensure that FORCE_SCRIPT_NAME would work on my production server, I first wanted to test it on the dev server. So I took an already existing project and added FORCE_SCRIPT_NAME to it., then did python manage.py runserver.
The expected result is that it would behave exactly as if I had followed all of the setup instructions for lighttpd+fcgi. (IE if I got to the
URL specified by FORCE_SCRIPT_NAME, I should get the root of the site)
The result was an absolutely unusable site.
First, I got a 404 when trying to access the site root, including the FORCE_SCRIPT_NAME. In order to get the root of the site, I have to go to "/".
Second, reverse() appears to work, because any links that are generated with URL tags or reverse() appear as expected.
Third, when I click on one of those links, I get another 404, but for a strange reason. The 404 page sent when debug=True acts as if I enter the value for FORCE_SCRIPT_NAME twice before entering the rest of the URL and submitting, which is utterly confusing.
I think either this should be fixed, the FORCE_SCRIPT_NAME should be outright ignored when using the dev server, or it should be documented that it does not work with the dev server.
Attached is a bare-bones all-default project that shows the behavior.
Change History (17)
comment:1 Changed 8 years ago by
|Patch needs improvement:||unset|
|Summary:||FORCR_SCRIPT_NAME does not work at all in dev server → FORCE_SCRIPT_NAME does not work at all in dev server|
comment:3 Changed 8 years ago by
|Summary:||FORCE_SCRIPT_NAME does not work at all in dev server → FORCE_SCRIPT_NAME does not work with dev server|
|Triage Stage:||Unreviewed → Design decision needed|
comment:6 Changed 5 years ago by
|Status:||new → closed|