Metadata-Version: 2.1
Name: django-access-timer-middleware
Version: 1.1
Summary: Access timer middlware is a middleware which allow to control access to some paths, like/api/, /admin/ and what you want!
Home-page: https://github.com/pavelbeard/django-access-timer-middleware
Author: pavelbeard
Author-email: heavycream9090@icloud.com
License: MIT License
Classifier: Environment :: Web Environment
Classifier: Framework :: Django
Classifier: Framework :: Django :: 2.2
Classifier: Framework :: Django :: 3.0
Classifier: Framework :: Django :: 3.1
Classifier: Framework :: Django :: 3.2
Classifier: Framework :: Django :: 4.0
Classifier: Framework :: Django :: 4.1
Classifier: Framework :: Django :: 4.2
Classifier: Framework :: Django :: 5.0
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: django>=3.2
Requires-Dist: django-newsingleton>=1.0

# 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:

```bash
pip install django-access-timer-middleware
```
In settings.py write next stuff:

INSTALLED_APPS:
```python
INSTALLED_APPS = [
    ...,
    'access_timer_middleware',
    ...,
]
```

MIDDLEWARE:
```python
MIDDLEWARE = [
    ...,
    'access_timer_middleware.middleware.AccessTimerMiddleware',
]
```

And then:

```bash
python manage.py makemigrations
python manage.py migrate
```
## description

The default access time to endpoints is 1 hour. <br/>
After expiring access time you won't get some endpoint, then you will receive error 403.<br/>
That value you can change in admin panel.
Available the next values:
<ul>
    <li>1 hour</li>
    <li>3 hours</li>
    <li>6 hours</li>
    <li>1 day</li>
    <li>2 weeks</li>
</ul>

## How to use?

In settings.py you should to set a one of two constants:



```python
RESTRICTED_PATHS = ['/api/']
```
The paths are participating in checking access

or...

```python
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
