Loading initial data for your Django app

Django provides no way to specify the order in which your models initial data is loaded. When I’m just starting up with a new project i tend to nuke and rebuild the database every 30 minutes or so of messing around.

To overcome this order problem in loading your data i put all my initial data in the same sql file so that it gets executed properly. Just pickup one of your models (or, better yet, create a dummy one) as the entry point and place everything in app/sql/example.sql

Have fun

Creating a symbolic link on Windows

Not everybody knows that it’s possible to create a symbolic link on NTFS: it’s called a junction and on OS < Windows Vista you have to download a small utility named, guess what, junction.exe

http://technet.microsoft.com/en-us/sysinternals/bb896768.aspx

But on Vista it ships natively: I used it to link Documents\Downloads to username\Documents\Downloads which is where stuff goes by default.

Here’s the command you wanted:

C:\Users\Lorenzo\Documents>mklink /d Downloads C:\Users\Lorenzo\Downloads
symbolic link created for Downloads <<===>> C:\Users\Lorenzo\Downloads

Take care