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
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
File details
Details for the file django-country-blocker-1.0.tar.gz
.
File metadata
- Download URL: django-country-blocker-1.0.tar.gz
- Upload date:
- Size: 2.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6048ed7d37200d55f1dcbd4730c7a103d1554b4011da9ea46ab9a41f42256bee |
|
MD5 | c3355ddd6b3d203ffee28736fc6e8525 |
|
BLAKE2b-256 | 7a0a5b76f30e487f4e87a191e97788e9224191df3569d418e8457d0ade52e2ec |