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!
=====================
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for django-easy-timezones-0.1.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1c267f44824562731e763facbbfc53094d99ddc8b4978d0fc649eea05dff9a58 |
|
MD5 | afa09948ba6da2cf179ef1fb367dc94a |
|
BLAKE2b-256 | 2dc1bbc412d3d147c0ec51068f6763d723eeda2b40604aa7c76499ec110ad03c |
Close
Hashes for django-easy-timezones-0.1.3.macosx-10.7-intel.exe
Algorithm | Hash digest | |
---|---|---|
SHA256 | 64854ba72585e62ff35d4d152ecf9410e6323db1c285bdf15e22bd247d1b9d53 |
|
MD5 | bcf4525508f2fd87c37244e5715d9ce2 |
|
BLAKE2b-256 | 8019cc5560f03fbc9806ddce27c430f0042063c287083405fb27e23a249bad26 |