Created
June 19, 2019 13:57
-
-
Save kezabelle/0ed30ab4414d3c1c670692cfaebd1411 to your computer and use it in GitHub Desktop.
Django inconsistency around setting TZ into the environ depending on how settings are configured
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> import os | |
>>> os.environ['DJANGO_SETTINGS_MODULE'] = '' | |
>>> from django.conf import settings | |
>>> settings.configure(TIME_ZONE='UTC') | |
>>> os.environ['TZ'] | |
KeyError... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> import os | |
>>> os.environ['DJANGO_SETTINGS_MODULE'] = 'valid_path_to_settings' | |
>>> from django.conf import settings | |
>>> settings.TIME_ZONE | |
... | |
>>> os.environ['TZ'] | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment