A Django middleware for verifying the user's age before allowing them access to resources
Project description
A Django middleware for verifying the user's age before allowing them access to a resource. Developed for the purposes of the PSE Hackathon held in Sep 2024.
The user is expected to own an Android or iOS device with an NFC reader and a compatible passport.
Installation
- pip install age_verification_psehack
In your Django project's settings.py:
Add the following line the bottom of the MIDDLEWARE section:
- "age_verification_psehack.middleware.AgeVerificationMiddleware"
Add a new AGE_VERIFICATION_PATHS setting containing all paths requiring age verification:
- AGE_VERIFICATION_PATHS = ['/protected_path1', '/protected/path2']
For developers only: testing out local changes
In case if you need to make changes and test them, in the root of this repo run
- python pip install build
- python -m build
In the root of your Django project create a file requirements.txt with the following:
-e path/to/the/root/of/this/repo
Then run:
python -m pip install -r requirements.txt
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
Built Distribution
Hashes for age_verification_psehack-0.2.1.tar.gz
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 | 4f3d64aec219c940991134b948564eb24c38d590e4de3104668d29ad37c1c5ae |
|
| MD5 | 7e39e84cee916edd151df960609a7f70 |
|
| BLAKE2b-256 | 51a759ba13cc8d32dfc075dc254c6ed62e9af6053ec4de7e7781227642b14e1a |
Hashes for age_verification_psehack-0.2.1-py3-none-any.whl
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 | 14f187861a5c313459cd193826e3433fd5f381f3fea5377dae71e1e9c68f8bc0 |
|
| MD5 | 057a08a090c38bbaf452b9100a632f77 |
|
| BLAKE2b-256 | 004ac4a2b81467be4374ed15d9ab2c6e7663a58408c6762f5d2b4f29a76b145e |