使用 Django 1.8.17
我的谷歌统计数据中有很多404。这是因为有些网址的格式如下:
我无法想象如何摆脱这些en-us lang,在这种情况下最好用en替换。
以下是我的i18n设置:
# Language code for this installation. All choices can be found here:
# http://www.i18nguy.com/unicode/language-identifiers.html
LANGUAGE_CODE = 'en'
# If you set this to False, Django will make some optimizations so as not
# to load the internationalization machinery.
USE_I18N = True
# If you set this to False, Django will not format dates, numbers and
# calendars according to the current locale
USE_L10N = True
LANGUAGES = (('de', gettext('German')),
('en', gettext('English')),
('es', gettext('Spanish')),
('it', gettext('Italian')),
('fr', gettext('French')),
('ru', gettext('Russian')),
('ja', gettext('Japanese')),
('pt', gettext('Portuguese')),)
如果没有匹配,有没有办法重定向到相应的语言,默认为en?