Skip to main content

Easily set a localized timezone for users

Project description

Easily set a localized timezone for users


The full documentation is at


Install Awesome Django Timezones:

pip install awesome-django-timezones

Add it to your INSTALLED_APPS:


Add DjangoTimezonesMiddleware to your MIDDLEWARE_CLASSES:


Add js/awesome_django_timezones.js to your base template

<script src="{% static 'awesome_django_timezones/js/awesome_django_timezones.js' %}"></script>

(Optional) If you need Django to be timezone aware on the Admin page, you will have to extend the Admin base.html in your_project/templates/admin/base.html

{% extends 'admin/base.html' %}
{% load static %}

{% block footer %}
  {{ block.super }}

  <script src="{% static 'js/awesome_django_timezones.js' %}"></script>

{% endblock %}


  • Provides an accurate method of determining the an end user’s timezone and activating that timezone in Django.
  • Uses client side, JavaScript detection for the most accurate method of determining a timezone.
    • Uses the widely supported, native Intl JavaScript library to detect the client’s timezone. This library is not currently implemented for IE11.
  • Falls back to server side timezone detection via an IP API.
    • Fall back is provided for IE11 clients or clients with JavaScript disabled.
    • Relies on third-party IP API lookups by Consider purchasing a plan if you need more than 30k IP lookups/month or if you need support (no affiliation).
  • Set a fallback timezone to always use in case a timezone can’t be found with AWESOME_TZ_DEFAULT_TZ in your (Be sure to use the “TZ database name” column from

Running Tests

Does the code actually work?

source <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install -r requirements_test.txt
(myenv) $ tox


Tools used in rendering this package:


0.1.0 (2019-02-04)

  • First release on PyPI.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for awesome-django-timezones, version 0.3.0
Filename, size File type Python version Upload date Hashes
Filename, size awesome_django_timezones-0.3.0-py2.py3-none-any.whl (6.6 kB) File type Wheel Python version py2.py3 Upload date Hashes View
Filename, size awesome-django-timezones-0.3.0.tar.gz (7.4 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page