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

More like this

  1. another render_to_response wrapper by ro60 4 years, 4 months ago
  2. HTTP headers view decorator by dottedmag 4 years, 11 months ago
  3. Cache view by user (and anonymous) by rafaelsdm 9 months ago
  4. Fix for GZipMiddleware when serving files or streaming or using iterators by wojtek 2 years, 6 months ago
  5. ajax protocol for data by limodou 5 years, 2 months ago

Comments

jerry2801 (on October 19, 2009):

how can i use above code?

#

(Forgotten your password?)