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
Hashes for django-country-blocker-0.1.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | b49babfe04d8cd40dcc1af2ad23ec3b6ff14b684e0f76c5f40e29374a24b3948 |
|
MD5 | cbb516aa7a3c67b16b4b0a730d477382 |
|
BLAKE2b-256 | faf2d2ea112c7db532921b0f6feec1ab7f66690c2ba54e94860dc657ca2c5f12 |