#27063: Regex url routing + Localization (prefix_default_language)
-------------------------------------+-------------------------------------
Reporter: keithhackbarth | Owner: nobody
Type: Bug | Status: new
Component: | Version: 1.10
Internationalization |
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by urbaniak):
Language prefix always ends with slash -
https://github.com/django/django/blob/bc1e2d8e8edde6cc7d2657c68242a13ee65a15b8/django/urls/resolvers.py#L419.
It's added before your url regex.
I cannot reproduce the issue with /de/fr/whatever, I've made a testcase
here https://github.com/urbaniak/i18n_patterns_test - can you make a for
of it and try to reproduce this issue?
There's a tests.py file which assumes 404 on those "nested" urls.
response = self.client.get('/de/pl/test-parking/')
self.assertEqual(response.status_code, 404)
self.assertEqual(response.wsgi_request.LANGUAGE_CODE, 'de')
response = self.client.get('/pl/de/test-parking/')
self.assertEqual(response.status_code, 404)
self.assertEqual(response.wsgi_request.LANGUAGE_CODE, 'pl')
--
Ticket URL: <https://code.djangoproject.com/ticket/27063#comment:5>
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/072.ce0e90faae8133d5d170be4aa7302003%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.