401 HttpResponse

1
2
3
4
5
6
    class HttpResponseNotAuthorized(HttpResponse):
        status_code = 401

        def __init__(self, redirect_to):
            HttpResponse.__init__(self)
            self['WWW-Authenticate'] = 'Basic realm="%s"' % Site.objects.get_current().name

Comments

jerry2801 (on October 19, 2009):

how can i use above code?

#

(Forgotten your password?)

You may use Markdown syntax here, but raw HTML will be removed.