26 November, 2007

Django and Gant Charts

It has now been almost a full week since I started the complete inkedmag.com site and infrastructure redesign in Python using the Django web publishing framework on FreeBSD, and I am happy to report that it is awesome.   Mind you we're talking version .96 of the product, yet it truly is a dream with which to work.
I only recently started working with (and writing about) Cheetah, a wonderful python template engine, and had to very quickly learn yet another (Django's own template system).  I must admit that Cheetah is easier to ready and learn quickly, but Django's system is considerably more agile in terms of conditionals and modifiers inside the template itself.  There even happens to be a simple mechanism for cycling through a list continually changing on each iteration of the loop within which the cycle conditional resides.  Simply put, it is wonderful for automatically changing the background colour of a row in a list.  
For those unfamiliar with Django, it is simply one of the better web frameworks for content publishing on the web these days.  While learning curve can be a little steep for some pieces of the framework, as a whole the speed at which once can produce working pages and applications is staggering.  The ease and elegance of the system truly makes one enjoying creating new applications within the framework.  
The first application I chose to migrate from native python into the framework was a simple store locator.  The new version not only is considerably less lines of code, the database management was done for me at application creation/initialisation.  I then simply exported the data from my existing application and imported it into the new table(s) Django created.  
I could go on waxing poetic about every little bell and whistle, but I'd just be paraphrasing what many others have already pointed out online and otherwise.  Don't think of it as Ruby on Rails because it isn't, though that isn't to be taken as an insult to Ruby.  It is much more focused, cleaner and far simpler to setup and get running, including all of its own admin interfaces for the applications you create, as well as its own standalone development web server.  Check it out, you won't be disappointed.  This is going to save me a considerable amount of time.
Which brings me to my second point; Gant charts.  They are simply not something I find myself utilising on any regular basis, though I think that is going to change.  I'm my own boss and have found that gant charts produce the easiest visual way to show people the various pieces necessary for a project, when each portion can be expected to start and finish, all in parallel with the other projects for which I'm responsible (and/or coordinating).  

I feel that the use of this tool more than others really gives a great method by which to see which projects will take the bulk of the time, and what projects overlap, etc.  We have a system rewrite to produce and a whole server to replace, not to mention migrating certain custom software into the framework all before the new year.  This is doable, but only because we've clearly set realistic (though tight nonetheless) goals and time frames.    Consider using a gant chart if you have more than one project or component of a project which needs to be done in a given time frame.  Use one if you need to share with one or more people your schedule and need them to understand as quickly and clearly as possible that with which you are juggling or dealing.  You find yourself quickly addicted to its usability.

Labels: , , , , , , , , , , ,

07 November, 2007

Cheetah, Python's Powerful Template Engine

About six months ago I wrote an entry about using the Template Toolkit for perl, and how I found that it was almost as if giving perl a little taste of Python. Now, fast forward to present time and I find myself as my own boss once again and in a dedicated open-ended contract with Pinchazo Publishing Group for Nylon Magazine and more recently, Inked Magazine. This opportunity has also proved to be beneficial for me in that I get to choose the technologies with which to arm these businesses moving forward for their presence on the internet.

This brings me to some realisations to which i came today. Python's template engine "Cheetah" is considerably better than aforementioned Template Toolkit for perl. I'm currently writing a new online gallery application using Python, MySQL, Javascript, CSS and of course HTML on a BSD server running Apache 2.2. Today was the first actual coding day for implementing my design, and while there were certain changes of some underlying routines, I have to say that it is moving along much quicker and smoother than alloted/anticipated. I attribute this heavily to the ease of use found within the Cheetah library.

Some template engines add a quasi familiar set of language constructs which make using such a system doable but with that kludgey feeling. That is not that case with Cheetah and in true Python fashion, it integrates using constructs that closely parallel the standard Python syntax, as well as offering several additional alternatives to help adapt in various situations and code bases.

The beauty of using template system (as has been said before) is that you add an additional layer of separation of code from display to the point that in team/diverse environments, the coders and artists don't interfere with one another. A simple protocol of self-discipline for each individual to stick to their roles ensures that both content and display functionalities can be developed, and changed simultaneously without concern over coordinating the end result. The busier the schedule, the crazier the deadline, the quicker (and with a much higher level of confidence and lower level of stress) that a project can be implemented/modified/redesigned.

Once the gallery is fully operational, I will be updating this post to add a working link to the site. It should only be a few days from the committal of this blog entry, so keep up to date by subscribing via the codedevl rss feed (courtesy of atom).

Labels: , , , , , ,