GeoIP based redirection middleware
Project description
Django GeoIP Redirection
========================
[![Build Status](https://travis-ci.org/vinitkumar/django_geoip_redirection.svg?branch=feature/add-plugin-doc)](https://travis-ci.org/vinitkumar/django_geoip_redirection)
[![Coverage Status](https://coveralls.io/repos/vinitkumar/django_geoip_redirection/badge.png)](https://coveralls.io/r/vinitkumar/django_geoip_redirection)
It is a GeoIP based redirection middleware that redirects the user on basis of
geolocation of the user. It uses Maxmind's free version of geoip database.
Using the middleware
====================
In order to use the middleware include it into your middlewares list in the
settings file:
```python
MIDDLEWARE_CLASSES = (
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.locale.LocaleMiddleware',
'django.middleware.doc.XViewMiddleware',
'django.middleware.common.CommonMiddleware',
# Uncomment the next line for simple clickjacking protection:
# 'django.middleware.clickjacking.XFrameOptionsMiddleware',
'cms.middleware.page.CurrentPageMiddleware',
'cms.middleware.user.CurrentUserMiddleware',
'cms.middleware.toolbar.ToolbarMiddleware',
'cms.middleware.language.LanguageCookieMiddleware',
'django_geoip_redirection.middleware.LocationMiddleWare',
)
```
And add the `django_geoip_redirection_` to list of INSTALLED APPS:
```python
INSTALLED_APPS = (
'django_geoip_redirection',
....
)
```
You would also need to place the `GeoIP.dat.dat` present inside the data folder to
your project root directory.
Running the Tests
------------------
You can run the tests with via:
```bash
python setup.py test
make test
make all
python runtests.py
```
========================
[![Build Status](https://travis-ci.org/vinitkumar/django_geoip_redirection.svg?branch=feature/add-plugin-doc)](https://travis-ci.org/vinitkumar/django_geoip_redirection)
[![Coverage Status](https://coveralls.io/repos/vinitkumar/django_geoip_redirection/badge.png)](https://coveralls.io/r/vinitkumar/django_geoip_redirection)
It is a GeoIP based redirection middleware that redirects the user on basis of
geolocation of the user. It uses Maxmind's free version of geoip database.
Using the middleware
====================
In order to use the middleware include it into your middlewares list in the
settings file:
```python
MIDDLEWARE_CLASSES = (
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.locale.LocaleMiddleware',
'django.middleware.doc.XViewMiddleware',
'django.middleware.common.CommonMiddleware',
# Uncomment the next line for simple clickjacking protection:
# 'django.middleware.clickjacking.XFrameOptionsMiddleware',
'cms.middleware.page.CurrentPageMiddleware',
'cms.middleware.user.CurrentUserMiddleware',
'cms.middleware.toolbar.ToolbarMiddleware',
'cms.middleware.language.LanguageCookieMiddleware',
'django_geoip_redirection.middleware.LocationMiddleWare',
)
```
And add the `django_geoip_redirection_` to list of INSTALLED APPS:
```python
INSTALLED_APPS = (
'django_geoip_redirection',
....
)
```
You would also need to place the `GeoIP.dat.dat` present inside the data folder to
your project root directory.
Running the Tests
------------------
You can run the tests with via:
```bash
python setup.py test
make test
make all
python runtests.py
```
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
Close
Hashes for django_geoip_redirection-0.1.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | acd17c287c7f704f04b891e7c038ea02e9358b77cff9ad3c8537ff591d32da9f |
|
MD5 | 7abd37bee02dad0bb7227d5e0a3768cd |
|
BLAKE2b-256 | 05c85aa714b461c4b6a14bce34bd6831a5b11755e19f6c63e50cb77cfd5c0cce |