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

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