Django app to add a "position" field to the request, using GeoIP or GPS data given in the request headers
Project description
Django app to add a “position” field to the request, using GeoIP or GPS data given in the request headers. Some references about this:
Quick start
1 Install using pip:
pip install django-belt
2 Add “request_position” to your INSTALLED_APPS settings like this:
INSTALLED_APPS += ('request_position',)
3 Add the middleware:
MIDDLEWARE += ( 'request_position.middleware.RequestPositionMiddleware', )
Settings
REQUEST_POSITION_REMOTE_ADDR_ATTR (default: “REMOTE_ADDR”)
REQUEST_POSITION_DEFAULT_IP (default: “127.0.0.1”)
REQUEST_POSITION_DEFAULT_POSITION (default: None)
REQUEST_POSITION_DEFAULT_COUNTRY_CODE (default: None)
REQUEST_POSITION_COOKIE_NAME (default: “_request_position”)
REQUEST_POSITION_GEO_HEADER (default: “HTTP_GEOLOCATION”)
REQUEST_POSITION_OVERRIDE_LATITUDE_PARAM (default “lat”)
REQUEST_POSITION_OVERRIDE_LONGITUDE_PARAM (default “lon”)
REQUEST_POSITION_OVERRIDE_COUNTRY_CODE_PARAM (default “cc”)
REQUEST_POSITION_USE_GIS_POINT (default False)
History
1.0a5 (2017-2-28)
Fixed settings variables prefix.
Fixed problem with default REQUEST_POSITION_DEFAULT_COUNTRY_CODE value.
Added settings variables to README.
1.0a4 (2017-2-28)
Fixed problem with missing REMOTE_ADDR_ATTR setting variable.
1.0a3 (2017-2-28)
Fixed problem with missing header.
1.0a2 (2017-2-28)
Fixed Django 1.10 compatibility with new middleware.
1.0a1 (2017-2-21)
First release on PyPI.
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
Hashes for django-request-position-1.0a5.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | e8913c62073ac2e16fc503a567b2970053b0a56d1f657e9c9e59c34c3278b50d |
|
MD5 | 2dd9fa91c3c62a5bc7fd475c0ba6d953 |
|
BLAKE2b-256 | 5d9a3a6954b81633d190e8051f5a2dc61900ac14393f5f2abe25249546e3c626 |
Hashes for django_request_position-1.0a5-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 661f3ff26def8b97137ad9e9d316191a21c43817ea8e8d865b5319e2ce45db0a |
|
MD5 | 381d84d8fb3dd7e821fd84922351dc31 |
|
BLAKE2b-256 | b96dabae4db98006b76b16a47d4aa8433ae099492641ff3173882a61c7237ebb |