How can I change Django admin language?

后端 未结 3 1454
梦如初夏
梦如初夏 2021-02-13 00:54

I have a django 1.6 site with i18n working. I can change the frontend language with a select box in the top of the template, but I don\'t know if there is a django app or trick

3条回答
  •  醉话见心
    2021-02-13 01:10

    Here is a slightly modified version of a code snippet from the Django docs for admin/base.html that adds a language selection dropdown:

    {% block userlinks %}
    {{ block.super }}
    / 
    {% csrf_token %}
    {% endblock %}

    For this to work you also need to add the following to your urlpatterns:

    path('i18n/', include('django.conf.urls.i18n')),
    

提交回复
热议问题