python - Changing Django Timezone setting -


we have "erp like" project use_tz = false in our settings , set time_zone desired zone requested each client, since each client different site (each client has it's own wsgi proccess , settings file)

but moving django tenants (it gets hostname in middleware , changes db schema according it). , 1 settings file rule them all.

trying emulate previous behavior wrote middleware change timezone using django.utils.timezone.activate if call datetime.datetime still getting time using settings.time_zone instead "activated" timezone.

how should dealing timezone in scenario?

additional info:

  • it important same timezone user on same subdomain(tenant) independently of location of each user.
  • we using postgresql timestamp time zone fields.
  • al operations should remain date/time have.


Comments

Popular posts from this blog

python - Healpy: From Data to Healpix map -

c - Bitwise operation with (signed) enum value -

xslt - Unnest parent nodes by child node -