Pinax
Thanks to listening to the #ubuntu-uk PodCast - I came across this little gem.
It's a collection of reusable django apps - all designed to be reusable - together.
What this means?
This project needed a critical mass to get it off the ground. Basically the way things are referenced across all the apps need to be the same. There's no point having two reusable apps.. if they both require different ways of interfacing with the same object. They break if one has 'name' as being fullname, and ther other requires name to have two separate name fields (for firstname and lastname). You've then got to write a way of getting around this problem, which just increases as more features were added.
Well, the neat guys over @ pinax have started up a project on creating re-usalble apps that sing of the same hymnsheet - and they look awesome. Having watched a presentation on youtube, the following phrase (quoted) stood out for me:
"If you want a man to build a boat, do not send him out for wood and nails, but teach him to yearn for the wide and endless sea." -Antoine St Exupery
It's really accurate for these kind of projects - writing reusable apps off some other guys prescribed instructions doesn't fill the heart with glee - but seeing what can be achieved by doing this makes you want to contribute.
So Cloud27 was born - it's a social network, but made up of the componenets developed on pinax - meaning you get to play with what you're about to download an integrate into your own project.
It looks really good, and there's a project I've been meaning to do which has been yearning out for a kickstart - I think this may have just done it!
Jumping in.. Django+Facebook
It was easier than I thought to write my first django application, especially as I was using solely the administration interface as the front end. I didn't need to touch the view.py or forms.py to get things working the way they should. In my opinion (and my clients) that's a fantastic result.
So now, rather than let my skillset rest like that, I've decided to become a little more adventurous. I'm in the design stage of a django+facebook application. I'm wary about linking myself directly to facebook, so the application will have a 'core' element (where all the logic will sit) and a 'web' and 'fb' app, for handling the two interfaces, respectively.
This wonderful solution came from a guy called Will Larson, who blogged here. It's a great little article, on how to easily access the facebook api, using pyfacebook - but without the pyfacebook middleware. Although there may not be technical benefit in doing this, from an educational perspective I can immediately see how he accesses the API and how I can quite easily start to manipulate it myself, using FQL (Facebook Query Language).
I'm a little apprehensive, as I want to get the design right. I'm really looking forward to jumping into this project for a couple of hours a day, and seeing it evolve. I'm going to be putting all the code up on my bzr repo (football) - but I hope that in the not-so-distant future someone will poke me and ask to link it to Launchpad, so they can help too. However, this is a learning project for me, so I hope to do most of it myself, and understand all of it. I'll probably put a clause in the license that unless your code is commented enough for me to understand it.. you're-outta-here. Reckon that'll work?
Bazaar Repo Open
Now I've got the bug for a bit of coding (pardon the expression) - I thought it best to set up my own publically viewable bzr repo. Launchpad is a great platform for collaboration, but I feel like some of the stuff I'm working on doesn't belong on Launchpad. The projects I'm planning to work on have a shelf life of about a week, so I don't want to clutter up Launchpad until I know I have an applications that others will want to collaborate on. With bzr, when that time comes, it'll be easy to do.
So today, I spent a whole 10 minutes (I was amazed at how easy it was) setting up my bzr branch.. it's up at http://bzr.zrmt.com (using Launchpad's very same loggerhead browser).
If you want to check out the code, or branch it. I'd recommend just dropping me an email for now.. I'll link it to Launchpad so that we can all contribute the code to the same codebase.. after all.. that's what it's all about.
Django.. I finally made the jump.
After working on my own php + mysql system for Purchase Order Generation, I realised that in order to get the code 'right' - I'd need to rewrite it multiple times in order to utilies the Object Orientated advantages. After rewriting a single page about three times, each time improving my code and making it more scalable, I felt that I was wasting my time.. as each time I finished it, I'd improved myself sufficiently to see a better way of doing things. How annoying.
For the last few months, I've been looking to Django.. not for this project - but as something to be used for designing some private websites. It looked neat, used python (and language that I find quite intuitive) and a few guys from SBLUG used it.. so I knew I had some people to go to for support. However, my first few attempts at the tutorial involved me really immersing myself in the framework.. and having not used a framework before, I really wanted to undestand the entire structure of what I was doing.
Finally, I was able to designate a portion of my time to this new Django project. Since my php+mysql project needed rewriting, I thought Django would be a good way to kickstart that.. and I wasn't wrong. I don't think I'd have had much success had this been my first exposure to Django, but I managed to get things ticking over quite smoothly. I went through creating my models and populating the database with ease. There were a couple of problems that I had to get the guys in #django, and the lovely Danux from SBLUG to help me with.
Despite all that, what had taken me a few rewrites to do in php+mysql was running great in Django. I'd even managed to set things up so that the functonality I needed could be provided entirely thorough the admininstration interface. Coupled with the brilliant contributed permissions and user/group modules - I was able to set everything up exactly how I wanted.. with much more functionality that I could have hoped to acheive using my previous approach.
So, God Bless Django.. and I hope that this is the beginning of a fantastic partnership.
all my code is available on Launchpad.. www.launchpad.net/~andylockran