Hi Noumia,
> Whatever operations they do within the database, all dates will be saved with
> timezone, right?
Django stores datetimes using the UTC timezone on all database backends.
> But how do you identify the timezone of a user? is that something that I
> should ask the user for and save it, and then use it whenever is necessary?
> Why a TimeZoneMiddleWare is not available?
You can use GeoIP[1] to attempt a timezone resolution based on the IP address
or you can ask your user about it and save it.
I suggest you have a look at django-sundial[2] which ships with the required
fields and middlewares to handle all of this.
Cheers,
Simon
[1] https://docs.djangoproject.com/en/1.9/ref/contrib/gis/geoip/
[2] https://github.com/charettes/django-sundial
Le mardi 17 mai 2016 16:51:24 UTC-4, Noumia Ngangoum a écrit :
-- > Whatever operations they do within the database, all dates will be saved with
> timezone, right?
Django stores datetimes using the UTC timezone on all database backends.
> But how do you identify the timezone of a user? is that something that I
> should ask the user for and save it, and then use it whenever is necessary?
> Why a TimeZoneMiddleWare is not available?
You can use GeoIP[1] to attempt a timezone resolution based on the IP address
or you can ask your user about it and save it.
I suggest you have a look at django-sundial[2] which ships with the required
fields and middlewares to handle all of this.
Cheers,
Simon
[1] https://docs.djangoproject.com/en/1.9/ref/contrib/gis/geoip/
[2] https://github.com/charettes/django-sundial
Le mardi 17 mai 2016 16:51:24 UTC-4, Noumia Ngangoum a écrit :
Hi, how really work timezoned application?
Let's stay I set my app to be used worldwide, which means I have user in america, in africa, in europe...
Whatever operations they do within the database, all dates will be saved with timezone, right?
But how do you identify the timezone of a user? is that something that I should ask the user for and save it, and then use it whenever is necessary?
Why a TimeZoneMiddleWare is not available?
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/cb0c27d8-f404-4f19-a8b5-3d7d102e7da4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment