This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

django-moat is a mini-app adds an additional layer of authentication via HTTP Basic Auth. It’s primary use case is to prevent access staging, development, or otherwise private sites on the public internet. It is equivalent to configuring Basic Auth on your webserver (Apache, nginx) but works in environments where that is not possible (heroku).

Installation

From PyPi

pip install django-moat

To install from source

pip install -e git+https://github.com/amrox/django-moat#egg=django-moat

Configuration

Add moat.middleware.MoatMiddleware to your MIDDLEWARE_CLASSES:

MIDDLEWARE_CLASSES = (
    # Existing middleware classes
    "moat.middleware.MoatMiddleware",
)

moat has several configuration variable you may put in your settings.py

MOAT_ENABLED

Enable or disable moat. (True or False)

MOAT_ENABLED = True
HTTP_AUTH_REALM

Set Basic Auth Realm

HTTP_AUTH_REALM = ‘App Staging’
MOAT_ALWAYS_ALLOW_VIEWS

A list of views to allow through moat

MOAT_ALWAYS_ALLOW_VIEWS = [‘myapp.views.home’]
MOAT_ALWAYS_ALLOW_MODULES

A list of modules to allow through moat

MOAT_ALWAYS_ALLOW_MODULES = [‘oauth_provider.views’]
MOAT_ALLOW_ADMIN

Let the admin site through moat. Default: False.

MOAT_ALLOW_ADMIN = True
MOAT_DEBUG_DISABLE_HTTPS

Disable HTTPS. For testing purposes only. Don’t ship with this on.

MOAT_DEBUG_DISABLE_HTTPS = True

Finally you may want to set the SESSION_EXPIRE_AT_BROWSER_CLOSE setting.

Usage

Your site now requires that your authenticate with a staff-level user before accessing any non-whitelisted view. It is recommended that your add a dedicate staff-level user in the django admin for moat authentication.

By default, the admin views will be blocked by moat. You’ll either need to create a user with django-admin.py, or set MOAT_ALLOW_ADMIN to True.

Acknowledgements

Code borrowed from:

Thanks to Ryan Balfanz for suggesting the name moat.

Release History

Release History

0.1.1

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
django-moat-0.1.1.tar.gz (4.5 kB) Copy SHA256 Checksum SHA256 Source Mar 12, 2012

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting