Installing Linux

When you get up to the screen where you select which partition you want to put Linux on, make sure you choose manually!

Main things to remember are:

Leave EFI and Mac OSX partitions alone!

Select the partition or empty space which you want to install Linux on and set it to one of the formats that rEFIt supports (such as ext3, since rEFIt won't be able to detect ext4)

Remember to give yourself some swap space, about 1gb will do (if you're bothered)

Install the Linux boot-loader on the same partition that you're installing Linux! Chameleon has been tweaked to work with the hacked Mac OSX kernel so you need to keep it. Not to mention that Chameleon's interface is much prettier than GRUB.

If all went well, during your next boot you should be able to choose between Mac OSX Snow Leopard or Linux on the Chameleon boot-loader.

Test if both operating systems work properly!

Changing the default operating system in Chameleon

This started to annoy me after a while because Snow Leopard was the default OS and I don't particularly have a use for it.

So to change the default operating system, you'll need to know the partition details to point to. If you're not sure, reboot and check what Chameleon says by pressing TAB.

Typically it'd be hd(0,3) because it's on the first harddrive and third partition (EFI is 1st partition, Snow Leopard on the 2nd so 3rd is Linux)

In Mac OSX, go to the console and type in:

sudo vim /Extras/com.apple.Boot.plist

Go into edit mode (press "i" on the keyboard and use the arrow keys to navigate). Add in:

It's nice to have a calendar that displays all the days in a month, but sometimes its handy to also display the extra days padding the month so you don't end up with blank spots.

Left has no padding. Right has padding dates in grey.

I like to have more information when possible. So, to get those extra days you just have to use a simple method already built into the calendar system.

from calendar import Calendar, SUNDAY def generate_date_range(year, month): # Process the calendar month to get the proper start/end dates cal = Calendar(SUNDAY) # Make Sunday first day of the week days = [ day for day in cal.itermonthdates(year, month) ] return days

Another thing you may find helpful is to split the days into weeks for display in rows.

Sources

If you were to have content in your template which displayed content from an RSS feed hosted by your dev server, it would time out.

The reason why this happens is because the standard Django dev server does not support concurrency natively.

That means the first request to your template page would stay open while the tag opens a secondary connection to your RSS feed.

Because the dev server is single-threaded, it would keep waiting until the first request is finished before allowing the RSS thread to be parsed.

Eventually it times out and gives up, giving you an error.

Luckily, to get around this you don't have to modify the core Django files.

A user at github named James Aylett (jaylett) has created an excellent Django command called runconcurrentserver which allows you to start the server using an alternate command instead of "runserver" while still supporting the same arguments.

To use it:

Simply grab the files off his git repository or download using the browser.

Extract (if you downloaded the archive)

Move the files from "concurrent_test_server" and save it in "your_project/django_concurrent_server".

As you can see, there is some fluffing involved with creating a new class for something that could be done easily. The trick is finding a way to make it easier to re-use.

I found it annoying that registering tags using Library.simple_tag() automatically parses the context values (but did not allow access to it) and Library.inclusion_tag() supported the use of takes_context but the regular Library.tag() didn't.