Friday, August 31, 2012

Modifying Dictionary in Django Session Does Not Modify Session

I think this is worth knowing because I spent quite a long time trying to debug a related issue.

This is the original post from SO. Read the whole thing. Very useful.

In short,

Whenever editing a session object, it is also required to explicitly say that the object was modified. This can be achieved like so:
request.session['xyz'] = 'xyz'
request.session.modfied = True
or in the settings we set,

Thursday, August 16, 2012

Whenever creating a new folder/module put a blank in it

Whenever creating a new folder/module put a blank in it. This is required if you want to import from this module into another file.

Wednesday, August 15, 2012

Creating a Sproc/Function in your mysql db

I kept getting  You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line x.

I was trying to run the sql to create the sproc via a txt/sql file and then via terminal do a
$mysql -u root -p < sproc_create_filename.sql

Turns out, you need to have a DELIMITER when doing this. This is how I got it to finally work..

CREATE DEFINER = `username`@`%` PROCEDURE `sp_get_mainpage_data`(lpIntCustomerId INT)
-- , lpIntLocationId INT, lpStrLoanOfficerCode VARCHAR(48), lpIntDecision TINYINT, lpDateInitialScoreDate DATETIME,  lpDateEndScoreDate DATETIME

. and ( IS NOT NULL OR (sbjasmt.repeated = 'y' OR sbjasmt.status = 'incomplete'));

Just adding the DELIMITER // and END// sorted out the issue.

Tuesday, August 7, 2012

Addressing localhost from a VirtualBox VM

I believe this could be pretty useful if you use VirtualBox a lot..

If you're developing on your local machine (on localhost) and want to access localhost from a browser from inside a virtualmachine (which resides on the same local-machine) (maybe to test IE6?), you can reach localhost via

So the address for our app would typically be


Wednesday, August 1, 2012

Popular Posts