Created
August 8, 2012 21:19
-
-
Save nicksnell/3298867 to your computer and use it in GitHub Desktop.
HTTP Auth for Django w/ Barrel
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""WSGI application file""" | |
import os | |
from django.core.wsgi import get_wsgi_application | |
from barrel import cooper | |
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'project.settings') | |
django_app = get_wsgi_application() | |
auth_decorator = cooper.basicauth( | |
users=[('someuser', 'somepass'),], | |
realm='Password Protected' | |
) | |
application = auth_decorator(django_app) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment