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 users 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.5.tar.gz (8.4 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: django_doorkeeper-1.0.5.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.5.tar.gz
Algorithm Hash digest
SHA256 19c4b5b5234299cf64c655a43f6de5c6e0b37ed75830731328fd0dfe056acbf7
MD5 b79fc97438ea90d0948bb442a873ca8d
BLAKE2b-256 94683b165f55314b5ddc88064ed8c18b0ed7b873c7f9f94154d503128e8f983f

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