Ubuntu 14.04.4 LTS Python 3.5.1 Django 1.9.7
-Django 1.9 for internationalization has been completed
By following the steps below
Japanese at http://hoge.com/ja/huga
English at http://hoge.com/en/huga
Etc. can be switched.
--Added the following to path /to/project/project/urls.py
```python:urls.py
from django.conf.urls.i18n import i18n_patterns
```
```python:urls.py
urlpatterns += i18n_patterns('',
#If you want to switch the language of the admin page
url(r'^admin/', include(admin.site.urls)),
#If you want to switch the language of the app called myapp
url(r'^myapp/', include('myapp.urls', namespace='myapp')),
)
```
With this alone, you can switch languages.
Recommended Posts