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
""" Django middleware that enforcess login for all urls except login and | |
additional exception defined via url regexp or django url names. | |
""" | |
from re import compile | |
from django.conf import settings | |
from django.http import HttpResponseRedirect | |
from django.utils.http import is_safe_url | |
from django.shortcuts import resolve_url | |
LOGIN_URL = resolve_url(settings.LOGIN_URL) |