Desinerd : Dipankar's Blog

Django : using HTTP authentication for your views

Published: in Technical, , , , , , by . 8 Comments on Django : using HTTP authentication for your views.

This is a small tutorial on how to use HTTP authentication for your site. Firstly you need to copy this file to httpauth.py and place it at /httpauth.py import base64 from django.contrib.auth.models import User from django.http import HttpResponse from django.contrib.auth import authenticate, login ############################################################################# # def view_or_basicauth(view, request, test_func, realm = “”, *args, **kwargs): “”” […]