Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

django-access-timer-middleware

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

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!

  • 1.4
  • PyPI
  • Socket score

Maintainers
1

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.4

Updates

This package won't have updates, except of bug updates.

Author

pavelbeard

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc