Skip to main content

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

Project description

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 pytz pygeoip
```

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) 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.2.tar.gz (6.2 kB view details)

Uploaded Source

Built Distribution

File details

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

File metadata

File hashes

Hashes for django-easy-timezones-0.1.2.tar.gz
Algorithm Hash digest
SHA256 960f7976b2869faa1e38ea8b0b54a17ed207b534fa3ffd2d8007e7f3f98c8737
MD5 379bbd5ac0b820fcc53694cb304882e5
BLAKE2b-256 675d53ed579d80267e07fd820e6d59911a923f4de86e64dcb91ac831c1a27b13

See more details on using hashes here.

Provenance

File details

Details for the file django-easy-timezones-0.1.2.macosx-10.7-intel.exe.

File metadata

File hashes

Hashes for django-easy-timezones-0.1.2.macosx-10.7-intel.exe
Algorithm Hash digest
SHA256 a3b587c8583f16fa4df6113a5528d535c7bbcf2d4c027fbe24d29655d33dc0e1
MD5 5c787eea08c58d8565c0e370bad8c655
BLAKE2b-256 544cd0e18d5a275dfe5e295156bed941a1283ed312172d67d932089b4b41d6b8

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