0
The raw query below shows the following error:
query = Resume.objects.raw("""
SET TIMEZONE='America/Sao_Paulo';
SELECT id, datetime_now FROM resume;
""")
raise AssertionError("database connection isn't set to UTC")
AssertionError: database connection isn't set to UTC
If you remove SET TIMEZONE the error does not occur.
The database is configured as follows for Timezone:
# show timezone;
TimeZone
-------------------
America/Sao_Paulo
(1 row)
The Settings.py
LANGUAGE_CODE = 'en-us'
TIME_ZONE = 'America/Sao_Paulo'
USE_I18N = True
USE_L10N = False
USE_TZ = True
What could be causing this?
pq vc are using sql commands if you can use the Django ORM? vc can get these settings from
settings.py
easily– Davi Wesley