settings py ----------- ROOT_URLCONF urls_i18n if USE_I18N else urls u

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
settings.py
-----------
ROOT_URLCONF = 'urls_i18n' if USE_I18N else 'urls'
urls_i18n.py
------------
from django.conf.urls.defaults import *
from django.conf import settings
supported = dict(settings.LANGUAGES)
urlpatterns = patterns('',
(r'^(?P<locale>%s)/*' % ('|'.join(supported.keys())), include('urls')),
)
urls.py
-------
from django.conf.urls.defaults import *
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
(r'^admin/(.*)', admin.site.root),
)