Django (part4), djangopart4
How does Django handle language preferences (set Chinese based on this)
Behind these features, Django has a flexible model to determine the language used when installing and using applications.
To set a language preference for the installation phase, set LANGUAGE_CODE. If another translator does not find a translation, Django will use
This language serves as the default translation final attempt.
If you only want to run Django in the local language and the language file exists, simply set the LANGUAGE_CODE.
To allow each user to specify their preferred language, use LocaleMiddleware. LocaleMiddleware enables Django-based
To customize the content for each user. It customizes content for each user.
To use LocaleMiddleware, you must add
'Django. middleware. locale. LocaleMiddleware '. The order of middleware has an impact. It is best to follow the following requirements:
Make sure it is the first batch of installed middleware class.
Because LocalMiddleware uses session data, it must be placed after SessionMiddleware.
What does django mean?
There are four meanings! The meaning of words in English should be combined with statements and articles, because each word has multiple meanings. Which one do you want. jiangge shouxi is a Japanese hot pot, while jiangge (django) is the hero of the famous Western Part django. Why did you choose "jiangge" as the title? 2. design that brings clean results django brings clean and effective design... django strictly maintains the clean design, and all its code allows your developed Web programs to follow the best practices 3. remove your program flaws with all these features... django has all these features... django is written in Python. Python is an elegant, concise, and advanced programming language. quick django development... django's philosophy is to do everything possible to speed up development.