#27063: Regex url routing + Localization (prefix_default_language)
--------------------------------+--------------------
     Reporter:  keithhackbarth  |      Owner:  nobody
         Type:  Uncategorized   |     Status:  new
    Component:  Uncategorized   |    Version:  1.10
     Severity:  Normal          |   Keywords:
 Triage Stage:  Unreviewed      |  Has patch:  0
Easy pickings:  0               |      UI/UX:  0
--------------------------------+--------------------
 I'm having two issues on using a regex based url pattern with
 "prefix_default_language" that I was hoping to shed some insight on.

 My url.py file:

 {{{
 urlpatterns += i18n_patterns(
     url(r'^(?P<city>.+-parking)/?$', CityView.as_view()),
     prefix_default_language=False
 )
 }}}

 Issue 1: Regex that also match language prefixs

 If a city that matches my regex but begins with a language prefix, it
 shows a 404.
 For example: "/de-moines-parking" shows a 404. But "de/de-moines-parking"
 returns a 200. Also, cities that don't match one of my enabled languages
 match as well "/boise-parking" for example.

 Issue 2: Stacking

 Also the urls will stack languages, for example, "/de/fr/it/de-moines-
 parking" is loading a successful page instead of a 404.

 Any insight? Is this a bug or am I missing something obvious in my regex?
 Prior to Django 1.10, I used solid_i18n_patterns plugin and did not have
 these issues. I posted on #django-users but no one responded.

 Thanks in advance,

 Keith

--
Ticket URL: <https://code.djangoproject.com/ticket/27063>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/057.07f9cce37378f0dacc3c0b58a5f6c30e%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to