a question about django admin and language

44 views
Skip to first unread message

Paul Z

unread,
Feb 25, 2016, 8:37:54 AM2/25/16
to django...@googlegroups.com
Hi,

I'm new to django, I try to set up a site that can select language automatically.
So, I set as below:

LANGUAGE_CODE = 'en'

TIME_ZONE = 'UTC'

USE_I18N = True

USE_L10N = False

USE_TZ = False

For now, It can select language automatically, But, The question is:

I don't want to it select language in Django Admin Interface, I want to it always display in English.

So, How to?

Thanks
Paul Z

Will Harris

unread,
Feb 26, 2016, 8:47:42 AM2/26/16
to Django users
Hi Paul,

If you want the admin site to behave differently than the main site, you could consider running two instances, one with the i18n activated for the main site, and one for admin users with it disabled. In production, from a security standpoint, it's a good idea to have the admin site running with different settings/access in any case.

Will

Luis Zárate

unread,
Mar 2, 2016, 9:29:46 AM3/2/16
to django...@googlegroups.com
You could write a middleware after language middleware than check if it is a admin URL and change the language to English.

https://docs.djangoproject.com/en/1.9/topics/http/middleware/

https://docs.djangoproject.com/es/1.9/topics/i18n/translation/
> --
> You received this message because you are subscribed to the Google Groups "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
> To post to this group, send email to django...@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/b612e437-c093-4c06-b7ec-e53244402b2d%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

--
"La utopía sirve para caminar" Fernando Birri



Reply all
Reply to author
Forward
0 new messages