推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
pythonee
V2EX  ›  Python

django 怎么使用多种语言,前台使用 en_US,而 admin 使用 zh_CN

  •  
  •   pythonee · Jun 11, 2015 · 2603 views
    This topic created in 4060 days ago, the information mentioned may be changed or developed.
    settings.py里面可以只指定一种语言,我怎么能在admin的时候使用另外一种语言呢
    5 replies    2015-06-12 11:19:53 +08:00
    lyhapple
        1
    lyhapple  
       Jun 11, 2015
    改源码去吧
    glasslion
        3
    glasslion  
       Jun 11, 2015
    写个 Middleware, 对 前台 的 request ,把 Accept-Language 头设成英文,
    recall704
        4
    recall704  
       Jun 12, 2015
    可以用cookie 來实现
    pythonee
        5
    pythonee  
    OP
       Jun 12, 2015
    @glasslion
    @recall704

    中间件这个方式应该可以
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2921 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 35ms · UTC 14:57 · PVG 22:57 · LAX 07:57 · JFK 10:57
    ♥ Do have faith in what you're doing.