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
|
More like this
- another render_to_response wrapper by ro60 4 years, 1 month ago
- HTTP headers view decorator by dottedmag 4 years, 8 months ago
- HTTP basic auth decorator by bthomas 3 years ago
- Cache view by user (and anonymous) by rafaelsdm 5 months, 2 weeks ago
- Fix for GZipMiddleware when serving files or streaming or using iterators by wojtek 2 years, 3 months ago
Comments
how can i use above code?
#