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)
Changed 7 years ago by ElliottM
comment:1 Changed 7 years ago by ElliottM
- Needs documentation unset
- Needs tests unset
- Patch needs improvement unset
- Summary changed from FORCR_SCRIPT_NAME does not work at all in dev server to FORCE_SCRIPT_NAME does not work at all in dev server
comment:3 Changed 7 years ago by jacob
- Summary changed from FORCE_SCRIPT_NAME does not work at all in dev server to FORCE_SCRIPT_NAME does not work with dev server
- Triage Stage changed from Unreviewed to Design decision needed
Changed 7 years ago by guettli
comment:6 Changed 4 years ago by Alex
- Easy pickings unset
- Resolution set to duplicate
- Status changed from new to closed
- UI/UX unset
comment:7 Changed 4 years ago by jezdez
- Resolution duplicate deleted
- Status changed from closed to reopened
comment:8 Changed 4 years ago by jezdez
- Triage Stage changed from Design decision needed to Accepted