Opened 4 months ago

Last modified 8 weeks ago

#21579 new Bug

i18n_patterns redirect not working with script prefix (sub path)

Reported by: buettgenbach@… Owned by: nobody
Component: Core (URLs) Version: master
Severity: Normal Keywords: i18n_patterns SCRIPT_NAME i18n prefix
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: 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???)

Attachments (1)

i18n_patterns_with_script_name_patch.diff (2.9 KB) - added by buettgenbach@… 4 months ago.

Download all attachments as: .zip

Change History (2)

Changed 4 months ago by buettgenbach@…

comment:1 Changed 8 weeks ago by bpeschier

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

Add Comment

Modify Ticket

Change Properties
<Author field>
as new
The owner will be changed from nobody to anonymous. Next status will be 'assigned'
as The resolution will be set. Next status will be 'closed'

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.