Desinerd : Dipankar's Blog

Django : using a seperate memcached cloud for sessions

Published: in Technical, , , , , , , by . 2 Comments on Django : using a seperate memcached cloud for sessions.

When you are using a platform like django you realise how slow sessions can get when you are using the database as a backend. The problem of using a memory cache like memcached is the fact that when you restart the server to refresh the cache or remove stale objects, the problem is that you […]

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): “”” […]