Skip to main content

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-request-position

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)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for django-request-position, version 1.0.0
Filename, size File type Python version Upload date Hashes
Filename, size django_request_position-1.0.0-py3-none-any.whl (5.9 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size django-request-position-1.0.0.tar.gz (5.1 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page