python - How to change timezone in http response (django server)? -
i'm running django server without proxy:
python manage.py runserver 0.0.0.0:80
i set local timezone on linux server, it's correct:
root@83b3bf90b5c5:/app# date fri apr 7 12:38:42 msk 2017
also set local timezone on settings.py of django project:
time_zone = 'europe/moscow'
and checked it:
>>> django.utils.timezone import localtime, >>> localtime(now()) datetime.datetime(2017, 4, 7, 12, 38, 42, 196476, tzinfo=<dsttzinfo 'europe/moscow' msk+3:00:00 std>)
but when open webpage client (google chrome browser) - in http response headers timezone isn't local:
date:fri, 07 apr 2017 09:38:42 gmt
how can change timezone in http headers project globally?
how can change timezone in http headers project globally?
http date headers defined being in utc (represented historical reasons characters gmt
), neither django nor other server or framework allow localize them time zone. there reason want that?
django have means switching local time zone (see activate()), application-specific content, not http headers.
Comments
Post a Comment