Skip to main content

Django app introducing a Context Processor that adds users location information to the context.

Project description

django-country-blocker

Django app introducing a Context Processor that adds users location information to the context.

To activate, add country_block.context_processors.addgeoip to your CONTEXT_MODIFIERS. This will give you a user_country variable in your context with the users country code, and a in_country boolean set to True is the country matches one of the allowed countries.

Settings options

COUNTRY_BLOCK_ALLOWED_COUNTRIES : list of country codes that will trigger in_country == True if it contains the user’s country code COUNTRY_BLOCK_DEBUG : sets the user_country equal to an allowed country, letting you test as if you are in the allowed country. False by default

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

django-country-blocker-1.0.2.tar.gz (2.9 kB view details)

Uploaded Source

File details

Details for the file django-country-blocker-1.0.2.tar.gz.

File metadata

File hashes

Hashes for django-country-blocker-1.0.2.tar.gz
Algorithm Hash digest
SHA256 40a4c2ac188e25a2757fdcfb2da64b1358c7e2c73dcb21870e8320b4f84f79b1
MD5 580246cfe81a14bcbb2f9b81f265d423
BLAKE2b-256 eb4f6f438e31de811ebe402577f8a67a3de2de8259ecdb5d5f3004c275f16c92

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page