Skip to content

Dirty and insecure django pluggable to password-protect an entire website -- for instance, while under construction

License

Notifications You must be signed in to change notification settings

triopter/django-doorkeeper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Django-Doorkeeper

Django-Doorkeeper is a pluggable Django middleware that forces every visitor to a site to enter a password before viewing any pages. The password is the same for every user. Doorkeeper status is stored in a cookie and does not need to be re-entered on subsequent pageviews.

Doorkeeper IS NOT SECURE and should not be used for security purposes. Its intent is to protect a site from casual lookie-loos and stray bots. Under some circumstances you might do this with .htaccess and HTTP Basic Auth if your site is fronted with Nginx / Apache / etc. When it's not, this is a simple substitute.

Individual views can be exempted from the password prompt. See configuration documentation for more information.

Installation

pip install django-doorkeeper

Then configure as documented.

Configuration

See configuration documentation.

Demo App

This repository includes a demo application to showcase Doorkeeper's functionality. To run the demo:

  1. Navigate to the example directory:

    cd example
  2. Install Django and doorkeeper:

    pip install django
    pip install django-doorkeeper
  3. Run migrations and start the demo server:

    python manage.py migrate
    python manage.py runserver
  4. Visit http://127.0.0.1:8000/ in your browser. You'll be prompted for the password (default: "demo_password").

  5. To see a page that bypasses Doorkeeper, visit http://127.0.0.1:8000/public/

Testing

python runtests.py

Compatibility

Doorkeeper has been tested with Python 3.13 and Django 5.1 but will almost certainly work on many earlier and later versions. Maybe if anyone ever uses this, someday I'll get around to adding Tox and a test matrix.

About

Dirty and insecure django pluggable to password-protect an entire website -- for instance, while under construction

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published