Skip to main content

Easy timezones for Django (>=1.4) based on MaxMind GeoIP.

Project description

![Timezones. Yuck.](http://i.imgur.com/Qc2W47H.gif)

django-easy-timezones
=====================

Easy timezones for Django (>=1.4) based on MaxMind GeoIP.

Quick start
-----------

0. Install django-easy-timezones

```python
pip install django-easy-timezones
```

1. Add "easy-timezones" to your INSTALLED_APPS setting like this:

```python
INSTALLED_APPS = (
...
'easy_timezones',
)
```

2. Add EasyTimezoneMiddleware to your MIDDLEWARE_CLASSES

```python
MIDDLEWARE_CLASSES = (
...
'easy_timezones.middleware.EasyTimezoneMiddleware',
)
```

3. Add a path to the [MaxMind GeoIP database](http://www.maxmind.com/en/geolocation_landing) ([direct
link](https://raw.github.com/Miserlou/django-easy-timezones/master/GeoIP.dat) because I'm nice) in your settings file:

```python
GEOIP_DATABASE = '/path/to/your/geoip/database/GeoIP.dat'
```

4. Enable localtime in your templates.

```python
{% load tz %}
The UTC time is {{ object.date }}
{% localtime on %}
The local time is {{ object.date }}
{% endlocaltime %}
```

5. Twist one up, cause you're done, homie!

Project details


Download files

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

Source Distribution

django-easy-timezones-0.1.4.tar.gz (6.3 kB view details)

Uploaded Source

File details

Details for the file django-easy-timezones-0.1.4.tar.gz.

File metadata

File hashes

Hashes for django-easy-timezones-0.1.4.tar.gz
Algorithm Hash digest
SHA256 be0f5a68b5d0cc891ee6d0c40685a916c8fa2ee4e2521ceda0adcc54481a106e
MD5 c2209ba6c4ecc5db86f0f41667ff01bf
BLAKE2b-256 2e772d5dee490dc38a2b6b8a22786671aa1cb651e6f80d4d2ef77300325e10f1

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page