Alan Edwardes 3.0

Published 06/02/2010 at 3:39 PM, updated 06/02/2010 at 3:39 PM (GMT)

A little information about what I've been doing over the past few months blog wise.

Gubbins

I built a really basic blog framework using PHP called Gubbins, and slapped it on GitHub. I made some progress with it, but then started chasing my own tail by trying to write a template system... starting with giving the administration panel one to cater for things like mobile versions etc. It was a pretty dumb idea, the admin panel has to have a certain amount of logic in it for validation and displaying dynamic elements alone, and as I had no interest of using PHP as a parser for template language the result was less than worth writing. I started to question my own logic behind architectural changes to the "engine" of the beast, and began spiralling out of control. 3 days later I was found laying in a pool of my own feces drinking from my next door neighbour's pond, and that was the end of the PHP version of Gubbins. (I kinda drifted off at the end of that story, it was getting a little boring.)

I wanted to be able to write my own content management system, but not have to do trivial stuff. For instance, when I write a method of displaying content, e.g. a blog post view, I don't want to have to write an administration panel that I can then save and edit the data being put into the method. That makes the whole "Cool, I made that. Let's play." ethic a little difficult.

Pythons eat Rubies

So I started thinking about picking up other languages to do the job. Why? PHP annoyed me. The lack of structure from function names to layout conventions really sucks, and I wanted a framework that does the trivial stuff for me - security, authorization etc.

Python/Django and Ruby/Ruby on Rails were the two languages and frameworks that stood out to me because I'd had two friends raving about each of them at some point. After watching the really old Snakes and Rubies presentations and debate, I was swaying towards Django purely because I enjoyed Adrian's presentation more, and was generally more impressed by Django's capabilities.

The former is pretty fickle reasoning, but I was going to pretty much learn a new programming language whatever happened, so that was enough for me. The frameworks and languages both have their merits.

Linode vs Slicehost

I was with Slicehost, and after I gave up on Simplestats I set about installing mod_python onto my slice and attempted to start the first basic Django tutorial. I was using the development server (because the article told me to, I had no idea how to get Django running using Apache), and pretty much rushed through that document and ignored snippets of crucial information. FYI: Don't do that. I was skipping over stuff that I'd need at a later date because of my short attention span.

I used SQLite for the first time, and found it to be exceedingly useful. A pretty much fully featured DB confined to a simple file - no daemon running in the background to configure. Sweet for development.

Once I'd messed up two attempts at trying the basic tutorial I heard about Linode opening up a new datacentre in the UK I switched hosts. Less latency alone was a bigger incentive than the RAM, and it turns out you get prettyful graphs showing CPU load, disk I/O and network activity. I'm a sucker for shiny things.

From my connection it takes 13-14 milliseconds to ping my linode, which is awesome.

I set about starting with Apache and mod_python from scratch on my new Linode, and got quite far with the tutorial. I got so confident with the simple nature of Django I decided to start again, but this time built a simple blog application using the polls tutorial as a vague guideline. This proved a successful feat. I found myself meticulously creating a nice grey design to go with it in no time. (That little joke would probably tickle one or two people at most, so take into account that I overuse grey quite considerably. Or don't if you like web pages constituting of different shades of black, up to you.)

I'm now hosting this blog on my shared A Small Orange account, using FastCGI to serve up my application. It's rewarding in the end, but I found FastCGI hell to get going in the first place. It was a problem with local paths not being prioritized by Python when run using FastCGI and the global version of Django being used instead of my later version... eughh. It works now though.

Pick Your Own Damn Colour

I'm still trying to evade my grey web-design phase, and couldn't really decide on a permanent colour because I'd start switching bits around and find myself bored with it. (Mainly why I used grey - there're only so many shades right? Can't get tempted to switch if there's nothing to switch to.) So, I figured if the content is semi dynamic, the design can be too - hence the jQuery colour picker above powered by the colour animation and cookie plugins.

If you change the colour you'll also notice the favicon changing too. This is achieved by manipulating the link object that the favicon is defined by, but if you're on anything but Firefox/gecko it won't update live.

The theme is pretty minimalist right now, and the sidebar isn't populated with much. That will probably change as I switch stuff around, as I normally end up doing.

Django, Swiss Army Knife of the Web

The built in administration panel builds itself from your models, the authorization module (that the admin panel uses too) is designed to be integrated into your project with ease - markdown, comments, serializing data formats, cross site forgery check for forms, database ORM... it's pretty feature-laden. Django has given me a pretty gentle introduction to the MVC (or MTV) architecture. With PHP, there was little mention of any kind of structure, you just whacked in code and hoped it worked. The same with layout - you didn't have to indent, so my first creations were completely unreadable. I do lay some blame on the PHP docs for not making it seem at all significant, but I guess I didn't see the importance in layout either when I first started out.

If Django doesn't have the functionality you need built right in, alls you need to do is search for the module you're looking for and you'll most likely find something useful.

The caching module is something that is seamless, and built into Django itself. I enabled it and found it had little mandatory configuration - it Just Works.

My Old Posts

My old posts are still available to anyone that is looking, but I haven't made them available as an archive on this site. As a rule, this is a new start - it's not as exciting if I port all of my old posts back over. Some are very inconsistently formatted as I was using different themes at times of writing, and I'm not prepared to go through them and re-write the HTML.

Welcome to the new site.

Add a Comment

Comment (No HTML, URIs are automagically made clickable)