After crying under my desk for a while over this problem I got the courage to come on SO and ask this question. I have a django model: entry_time = models.DateTimeField(auto_now_add=True)
On my admin change_form.html
and change_list.html
I would like to display that object in local time. I've read the django docs on this, my biggest problem I think is that I'm modifying the template and am not directly calling the object.
Settings.py:
TIME_ZONE = 'UTC'
USE_I18N = True
USE_L10N = True
USE_TZ = True
I have tried changing the TIME_ZONE to US/Arizona which didn't work. I tried solutions i found at Setting Django admin display times to local time? such as custom templates using
{% extends "admin/change_list.html" %}
{% load tz %}
{% block content %}
{% timezone "US/Eastern" %}
{{ block.super }}
{% endtimezone %}
{% endblock %}
This did nothing, my time is still UTC on change_form. I tried installing a middleware package (awesome-django-timezones) that uses js to find local timezone and change it using middleware. This did nothing as well.
I also tried going into options.py and adding activate() into the view that calls change_form.html-- no success.
Am I missing something? How can I extend the admin templates to display local time? Is this a DB issue? I've read postgresql save the object and timezone and converts back and forth between UTC well, so I don't understand what my issue is.