django/conf/global_settings.py 中,我们可以找到关于language和timezone的通用配置信息,源码如下:

# Local time zone for this installation. All choices can be found here:
 
  # https://en.wikipedia.org/wiki/List_of_tz_zones_by_name (although not all
  # systems may support all possibilities). When USE_TZ is True, this is
  # interpreted as the default user time zone.
  TIME_ZONE = 'America/Chicago'
   
  # If you set this to True, Django will use timezone-aware datetimes.
  USE_TZ = False
   
  # Language code for this installation. All choices can be found here:
  # http://www.i18nguy.com/unicode/language-identifiers.html
  LANGUAGE_CODE = 'en-us'
   
  # Languages we provide translations for, out of the box.
  LANGUAGES = [
  ('af', gettext_noop('Afrikaans')),
  ('ar', gettext_noop('Arabic')),
  ('ast', gettext_noop('Asturian')),
  ('az', gettext_noop('Azerbaijani')),
  ('bg', gettext_noop('Bulgarian')),
  ('be', gettext_noop('Belarusian')),
  ('bn', gettext_noop('Bengali')),
  ('br', gettext_noop('Breton')),
  ('bs', gettext_noop('Bosnian')),
  ('ca', gettext_noop('Catalan')),
  ('cs', gettext_noop('Czech')),
  ('cy', gettext_noop('Welsh')),
  ('da', gettext_noop('Danish')),
  ('de', gettext_noop('German')),
  ('dsb', gettext_noop('Lower Sorbian')),
  ('el', gettext_noop('Greek')),
  ('en', gettext_noop('English')),
  ('en-au', gettext_noop('Australian English')),
  ('en-gb', gettext_noop('British English')),
  ('eo', gettext_noop('Esperanto')),
  ('es', gettext_noop('Spanish')),
  ('es-ar', gettext_noop('Argentinian Spanish')),
  ('es-co', gettext_noop('Colombian Spanish')),
  ('es-mx', gettext_noop('Mexican Spanish')),
  ('es-ni', gettext_noop('Nicaraguan Spanish')),
  ('es-ve', gettext_noop('Venezuelan Spanish')),
  ('et', gettext_noop('Estonian')),
  ('eu', gettext_noop('Basque')),
  ('fa', gettext_noop('Persian')),
  ('fi', gettext_noop('Finnish')),
  ('fr', gettext_noop('French')),
  ('fy', gettext_noop('Frisian')),
  ('ga', gettext_noop('Irish')),
  ('gd', gettext_noop('Scottish Gaelic')),
  ('gl', gettext_noop('Galician')),
  ('he', gettext_noop('Hebrew')),
  ('hi', gettext_noop('Hindi')),
  ('hr', gettext_noop('Croatian')),
  ('hsb', gettext_noop('Upper Sorbian')),
  ('hu', gettext_noop('Hungarian')),
  ('ia', gettext_noop('Interlingua')),
  ('id', gettext_noop('Indonesian')),
  ('io', gettext_noop('Ido')),
  ('is', gettext_noop('Icelandic')),
  ('it', gettext_noop('Italian')),
  ('ja', gettext_noop('Japanese')),
  ('ka', gettext_noop('Georgian')),
  ('kab', gettext_noop('Kabyle')),
  ('kk', gettext_noop('Kazakh')),
  ('km', gettext_noop('Khmer')),
  ('kn', gettext_noop('Kannada')),
  ('ko', gettext_noop('Korean')),
  ('lb', gettext_noop('Luxembourgish')),
  ('lt', gettext_noop('Lithuanian')),
  ('lv', gettext_noop('Latvian')),
  ('mk', gettext_noop('Macedonian')),
  ('ml', gettext_noop('Malayalam')),
  ('mn', gettext_noop('Mongolian')),
  ('mr', gettext_noop('Marathi')),
  ('my', gettext_noop('Burmese')),
  ('nb', gettext_noop('Norwegian Bokmål')),
  ('ne', gettext_noop('Nepali')),
  ('nl', gettext_noop('Dutch')),
  ('nn', gettext_noop('Norwegian Nynorsk')),
  ('os', gettext_noop('Ossetic')),
  ('pa', gettext_noop('Punjabi')),
  ('pl', gettext_noop('Polish')),
  ('pt', gettext_noop('Portuguese')),
  ('pt-br', gettext_noop('Brazilian Portuguese')),
  ('ro', gettext_noop('Romanian')),
  ('ru', gettext_noop('Russian')),
  ('sk', gettext_noop('Slovak')),
  ('sl', gettext_noop('Slovenian')),
  ('sq', gettext_noop('Albanian')),
  ('sr', gettext_noop('Serbian')),
  ('sr-latn', gettext_noop('Serbian Latin')),
  ('sv', gettext_noop('Swedish')),
  ('sw', gettext_noop('Swahili')),
  ('ta', gettext_noop('Tamil')),
  ('te', gettext_noop('Telugu')),
  ('th', gettext_noop('Thai')),
  ('tr', gettext_noop('Turkish')),
  ('tt', gettext_noop('Tatar')),
  ('udm', gettext_noop('Udmurt')),
  ('uk', gettext_noop('Ukrainian')),
  ('ur', gettext_noop('Urdu')),
  ('vi', gettext_noop('Vietnamese')),
  ('zh-hans', gettext_noop('Simplified Chinese')),
  ('zh-hant', gettext_noop('Traditional Chinese')),
  ]

在这里,我们可以找到关于language_code的缩写,对应的关于time_zone,我们可以在这里找到相关信息

#something you want can find by https://github.com/django/django/blob/master/django/conf/global_settings.py
# Local time zone for this installation. All choices can be found here:
# https://en.wikipedia.org/wiki/List_of_tz_zones_by_name (although not all
# systems may support all possibilities). When USE_TZ is True, this is
# interpreted as the default user time zone.

TIME_ZONE

Default: 'America/Chicago'

A string representing the time zone for this installation. See the list of time zones.

Note

Since Django was first released with the TIME_ZONE set to 'America/Chicago', the global setting (used if nothing is defined in your project’s settings.py) remains 'America/Chicago' for backwards compatibility. New project templates default to 'UTC'.

Note that this isn’t necessarily the time zone of the server. For example, one server may serve multiple Django-powered sites, each with a separate time zone setting.

When USE_TZ is False, this is the time zone in which Django will store all datetimes. When USE_TZ is True, this is the default time zone that Django will use to display datetimes in templates and to interpret datetimes entered in forms.

On Unix environments (where time.tzset() is implemented), Django sets the os.environ['TZ'] variable to the time zone you specify in the TIME_ZONE setting. Thus, all your views and models will automatically operate in this time zone. However, Django won’t set the TZ environment variable if you’re using the manual configuration option as described in manually configuring settings. If Django doesn’t set the TZ environment variable, it’s up to you to ensure your processes are running in the correct environment.

Note

Django cannot reliably use alternate time zones in a Windows environment. If you’re running Django on Windows, TIME_ZONE must be set to match the system time zone.

看看官方这段的描述,所以当我们使用windows开发的时候,还是要注意以上的一些问题的。

最新文章

  1. javascript类型系统——日期Date对象
  2. Codeforces Round #108 (Div. 2)
  3. 9本java程序员必读的书
  4. <s:property="a" value=""/>取的<s:debug></s:debug>中的value stack中的属性值
  5. WinForm中当TextBox重新获得焦点时输入法失效问题
  6. python ssh弱口令爆破多线程脚本及遇到的一些错误与问题
  7. mac 连接linux
  8. NAS4Free 安装配置(四)配置硬盘
  9. Windows下composer的下载与配置
  10. 利用子集构造法实现NFA到DFA的转换
  11. JDBC详解系列(四)之建立Stament和执行SQL语句
  12. Django目录
  13. Python字符串常用方法(一)
  14. PHP之高性能I/O框架:Libevent(三)
  15. 牛客多校第三场-A-PACM Team-多维背包的01变种
  16. UI5-文档-2.5-开发混合Web容器
  17. Docker swarm结合Openresty部署rabbitmq集群
  18. hdu-1171(多重背包+二进制优化)
  19. c++——默认参数、函数占位参数
  20. NOIP2018 生气记

热门文章

  1. 用gethub下载ardupilot的最新源码
  2. Day2 HTML基本标签元素
  3. Django的路由层和视图层
  4. ps钢笔工具路径问题
  5. MySQL使用一张表的一列更新另一张表的一列
  6. codevs 2620 战壕
  7. C# ,通用内存集合对象分页、筛选(lambda那点事)
  8. 【文件拷贝】使用Total Commander Portable拖动拷贝文件,支持队列
  9. IOS 创建一个可以随意拉伸不变形的图片
  10. xtrabackup支持的engine