Django i18n: how to not translate the admin site?

前端 未结 4 1774
情书的邮戳
情书的邮戳 2020-12-30 03:13

I have an application in several languages but I would like to keepthe admin site always in english. What is the best way to do this?

Thanks in advance.

4条回答
  •  自闭症患者
    2020-12-30 03:17

    I would setup two settings files:

    1. settings.py for whole project
    2. admin_settings.py for admin only

    Then host this project in separate domains:

    1. example.com
    2. admin.example.com

    If you have separate settings files for admin and rest of the project, you can override language settings in your admin_settings.py

    You will probably have very similar settings files, so following line on the top of admin_settings.py will be handy:

    from my_project.settings import *
    

提交回复
热议问题