I have URLs in the following form:
http:
I need to do:
1. Based on the language code, I want to select the appropriate DB or raise Http 404 if the language code is not supported.
2. I would like to save the language code in the request object, so I can access it in my templates.
3. I would like my urls.py to look different:
url(r'^(?P<lang>\w+)/xxx/$', 'my_app.views.xxx')
but rather:
url(r'^xxx/$', 'my_app.views.xxx')
therefore django completely ignores the language code in the url.
Can someone tell me please if this is doable with django or should I look for another solution?
source
share