Skip to main content
Help us improve PyPI by participating in user testing. All experience levels needed!

Simple password-only protection

Project description

Info:Super simple password protection for limiting public access to pages and assets
Version: 0.2.1
Author: Ben Lopatin (

Django Simple Auth is a secondary authentication system for protecting any URLs served by your application from public access. It does not replace your authentication system. Rather its purpose is to provide very simple a simple password for non-public information like shared photo galleries.


First add the application to your Python path. The easiest way is to use pip:

pip install django-simple-auth

As of version 0.2.0 this is only tested against Django 1.11+ and is probably compatible with Django 1.10 but this has not been tested.


Make sure you have django.contrib.auth installed, and add the simple_auth application to your INSTALLED_APPS list:


Next add simple_auth.urls to your project URLs.:

url(r'^protect/', include('simple_auth.urls')),

If you want to enable default rule-based limits on your site, install the SimpleAuthMiddleware:


By default this will require a password for all URLs except for URLs prefaced with /admin/. These URLs can be overridden using protect and ignore settings.:



If a URL is listed in both the ignore and protect lists the default will be to protect the URL and simple_auth will emit a warning.

Usage overview

There are two ways to protect pages and assets: view decorators and middleware.

These methods will always allow authenticated users to access the URL.


To enable the middleware install the middleware class as described in the installation section.

Individual views

Note: not implemented yet.

For function views:

from simple_auth import simple_auth_required

def myview(request):

For class-based views:

from simple_auth import SimpleAuthMixin

class MyView(SimpleAuthMixin, DetailView):

Project details

Release history Release notifications

This version
History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
django_simple_auth-0.2.1-py2.py3-none-any.whl (8.5 kB) Copy SHA256 hash SHA256 Wheel py2.py3 Jun 7, 2017
django-simple-auth-0.2.1.tar.gz (5.5 kB) Copy SHA256 hash SHA256 Source None Jun 7, 2017

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page