#17734: 302 redirect to standard language for non-i18n URL's when returning 404.
--------------------------------------+---------------------------
     Reporter:  petar@…               |      Owner:  nobody
         Type:  Bug                   |     Status:  new
    Component:  Internationalization  |    Version:  SVN
     Severity:  Normal                |   Keywords:  urlconf, i18n
 Triage Stage:  Unreviewed            |  Has patch:  0
Easy pickings:  0                     |      UI/UX:  0
--------------------------------------+---------------------------
 I'm using [Tastypie] to supply an API for my project. This API should be a
 language independent URI, while some other applications have language
 dependent URI's. This leaves me with the following URLConf:

 {{{
 from django.utils.translation import ugettext_lazy as _
 from django.conf.urls.defaults import patterns, include, url
 from django.conf.urls.i18n import i18n_patterns

 urlpatterns = patterns('',
     url(r'^api/', include(v1_api.urls)),
 )

 urlpatterns += i18n_patterns('',
     url(_(r'^something/'), include('something.urls')),
 )
 }}}

 When I raise a `404` in the API, the `LocaleMiddleware` detects this and
 tries to redirect to `/en/api/[..]`. I think this happens because
 `is_language_prefix_patterns_used` always returns `True` because it loops
 through '''all''' the URL's in the URLConf and finds a locale URL.
 However, the URL for the API is not an Locale URL.

 [Tastypie]: https://github.com/toastdriven/django-tastypie

-- 
Ticket URL: <https://code.djangoproject.com/ticket/17734>
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 post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to