i18n_patterns redirect not working with script prefix (sub path)
|Reported by:||buettgenbach@…||Owned by:||nobody|
|Severity:||Normal||Keywords:||i18n_patterns SCRIPT_NAME i18n prefix|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
Assume the following url pattern:
urlpatterns += i18n_patterns('', url(r'^imprint/$', view, name='imprint'), )
"en" is the default language.
When running Django (for example behind a reverse proxy) a request to /imprint/ with SCRIPT_NAME='script_prefix" leads to the redirect "/en/script_prefix/imprint/" instead of "/script_prefix/en/imprint/".
I've already provided a patch with test. But I'm uncertain about the test, since the test client does not seem to call set_script_prefix (might be thought of as a bug???)