Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Django reusable app with decorators, views and forms for requiring a password to access some pages, without requiring users to create an account. Good for beta sites and soft lauches.
Branch: master

Merge pull request #1 from TTimo/master

Workaround for broken template loading.
latest commit d55dc61261
@mikl authored
Failed to load latest commit information.
password_required Adding Danish translation.
.gitignore Initial gitignore.
LICENSE A few details.
README.mkd Reformatting. the html wasn't being distributed


Django Password Required

A reusable Django app for requiring a password to access some pages on a site, without requiring users to register an account.

This is a very simple method of authentication, and is intended to provide a low barrier of entry to a site that is not completely public.

Use cases could be previews of sites that users are not supposed to log in to, Stack Overflow-style beta tests, etc.

Using the @password_required decorator, you can password-protect individual views.

This module is based on simple session variables, and thus interoperable with django.contrib.auth, allowing you to optionally bypass password protection for all authenticated users, or only for certain groups.


  1. Install the app.
    Not really within the scope of this document, but if you have pip installed, you could do something like this:

    pip install -e git+git://

    If you are developing multiple Django sites, you should probably use virtualenv to keep their dependencies separate.

  2. Add password_required to INSTALLED_APPS in your Django settings file.

  3. Set PASSWORD_REQUIRED_PASSWORD to the preferred password in your Django settings file. Example:

    PASSWORD_REQUIRED_PASSWORD = 'mysecretpassword'

  4. Add the password required login page to your URLconf. Example:

    (r'^password_required/$', 'password_required.views.login'),

  5. Apply the @password_required decorator to your views like in this final code example.

    from password_required.decorators import password_required [...more imports...]

    @password_required def my_awesome_view(request): [...view code here...]


This app requires Django 1.2 or later.


This app is BSD-licensed, just like Django.

Development, support and feedback

If you have problems, find a bug or have other feedback, please file an issue on the main Github repo.

Something went wrong with that request. Please try again.