Skip to main content

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

Project description

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 git+ssh://git@github.com:triopter/django-doorkeeper.git

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 git+ssh://git@github.com:triopter/django-doorkeeper.git
    
  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 every uses this, someday I'll get around to adding Tox and a test matrix.

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

django_doorkeeper-1.0.6.tar.gz (8.4 kB view details)

Uploaded Source

File details

Details for the file django_doorkeeper-1.0.6.tar.gz.

File metadata

  • Download URL: django_doorkeeper-1.0.6.tar.gz
  • Upload date:
  • Size: 8.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for django_doorkeeper-1.0.6.tar.gz
Algorithm Hash digest
SHA256 c54fed001fad268643f5e5522029c993b3ccbeeae1f6d1455279ddd15fa5e22d
MD5 bd198604844ac43dea7f87a6ab5835d8
BLAKE2b-256 0016b40004f6d9e46b931bf23d2e45455749755e8193281fe480bdbba6093746

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page