Access timer middlware is a middleware which allow to control access to some paths, like/api/, /admin/ and what you want!
Project description
django-access-timer-middleware
Access timer middleware is a middleware which allow to control access to some paths, like /api/, /admin/ and what you want!
How to install the package
To install the package, run:
pip install django-access-timer-middleware
In settings.py write next stuff:
INSTALLED_APPS:
INSTALLED_APPS = [
...,
'access_timer_middleware',
...,
]
MIDDLEWARE:
MIDDLEWARE = [
...,
'access_timer_middleware.middleware.AccessTimerMiddleware',
]
And then:
python manage.py makemigrations
python manage.py migrate
description
The default access time to endpoints is 1 hour.
After expiring access time you won't get some endpoint, then you will receive error 403.
That value you can change in admin panel.
Available the next values:
- 1 hour
- 3 hours
- 6 hours
- 1 day
- 2 weeks
How to use?
In settings.py you should to set a one of two constants:
RESTRICTED_PATHS = ['/api/']
The paths are participating in checking access
or...
EXCLUDED_PATHS = ['/api/stuff/login/', '/api/stuff/signup/', '/admin/']
...paths, which are excluded from it, but rest of the endpoints there are in checking.
Using those two constants at the same time will throw an exception.
Version
Current version: 1.1
Updates
This package won't have updates, except of bug updates.
Author
pavelbeard
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file django_access_timer_middleware-1.1.tar.gz.
File metadata
- Download URL: django_access_timer_middleware-1.1.tar.gz
- Upload date:
- Size: 3.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
46adfd4536c24428aa5d6843b3b90da7213a311872804d50d569da085454304a
|
|
| MD5 |
d251413f35947485cdbd78deff6f78bf
|
|
| BLAKE2b-256 |
34fa3e780bc615ff3adf6c34375df265e918bd84d3bd06a69d520fa57d8ff0aa
|
File details
Details for the file django_access_timer_middleware-1.1-py3-none-any.whl.
File metadata
- Download URL: django_access_timer_middleware-1.1-py3-none-any.whl
- Upload date:
- Size: 3.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ccdb1db7d16bbdadb314cba8490f7a2488259c7d7f406a16e73de7b22cc08147
|
|
| MD5 |
331d44be8ea71e39cbb77a276a957542
|
|
| BLAKE2b-256 |
aab60e9ba2c454060e4b207dcfeea796d9d2abce791853bc3d39ba792751e971
|