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.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | a976b04de9e4088411c198bb104eaf7199e6f3c4e613311d7921eb22834a206c |
|
MD5 | 2f3e59c2fde2345d1ae87a99555032a3 |
|
BLAKE2b-256 | 4cc2e9a971f4c2f5279f119a1f7d281f4dd69ec3f7f6baa16852259c981bda28 |
Close
Hashes for django-easy-timezones-0.1.1.macosx-10.7-intel.exe
Algorithm | Hash digest | |
---|---|---|
SHA256 | adf62009b88745a033028a64102400f91f78b1686d3fdb66f0c13f822f4a82c2 |
|
MD5 | 56c708f72f63b1eca824cc14c19b430a |
|
BLAKE2b-256 | c36c53ca986c21bad09fbee90c37278dfeef5361cf519a479b1b50ca17487055 |