CodeIgniter + nginx : Facebook application

This is a basic tutorial on how to get CodeIgniter facebook application on nginx (with the gotchas). The nginx configuration would be like the following server { listen 80; server_name blah.com; location ~ /index.php/ { root /home/production/blah; index index.html index.htm index.php; include conf/fcgi.conf; fastcgi_param SCRIPT_FILENAME /home/production/fb_apps/quickdate/index.php; fastcgi_pass 127.0.0.1:9000; } access_log /usr/local/nginx/logs/blah.access_log; error_log /usr/local/nginx/logs/blah.error_log; } The critical line is the fastcgi_params parameter, that changes the whole game. In the code Igniter application you need to add the following file in [app]/system/application/libraries/FB_controller....

November 19, 2008 · 1 min · 202 words · Me

Django : Optimizations within the platform

In my experience with both rails and django, i would have to admit that a lot of things need to be improved at the core of these platforms so that developers can truly deploy a really fast production site. Let talk about what we did at kwippy to make it that much more faster than the default Django setup. Use memcached properly : The trick in getting speed is to cache all logged out pages and heavy caching of the user objects when logged in....

November 18, 2008 · 2 min · 387 words · Me

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 lose your sessions data and a lot of people using your site get logged out. The only solution to this problem is to use 2 memcached instances , one for your regular python objects and another for your sessions objects … this is not a default feature in Django....

November 18, 2008 · 2 min · 400 words · Me

IIT versus everyone

“Life’s fair if you don’t compare” The basis of article is the above quote which has no known author. Yesterday, i was sitting with my friends and i was the only IITian sitting there. When these guys started talking about their university life, well I started to realize that the golden years of fun for them were the toughest years for me and my batch. To start this all out, lets go back to the end of 12th and then college life....

November 18, 2008 · 2 min · 353 words · Me

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): """ This is a helper function used by both ‘’logged_in_or_basicauth’’ and ‘‘has_perm_or_basicauth’’ that does the nitty of determining if they are already logged in or if they have provided proper http-authorization and returning the view if all goes well, otherwise responding with a 401....

November 15, 2008 · 3 min · 526 words · Me