You are accessing the archives. Commenting has been disabled, and archive posts are likely to be horribly out of date and, in some cases, rendered oddly because the styles from archive posts are no longer being maintained.
June 24, 2007

The Iron Lion : Reincarnation

It is late, but I have finally had the chance the deploy a still yet simple version of The Iron Lion. While the development for this has been fun, and has led to a lot of education, I felt this week that I just need to be able to call it finished and slap a version on it, before I continue screwing with it. My biggest gripe with writing code is that there is always feature creep, and I have found myself guilty of that as well. This is how I combat it. Currently, the site isn't going to eclipse the sun anytime soon, but I think I'm learning to deploy with known issues and bugs, as well as a slew of wanted features, for which only a few of them have a high enough priority to even be considered for the next iteration. I am a software developer with no self control...

The entirety of this site is now Django powered, which is what took the most development time. This is not because Django is difficult to work with, but because (1) my python skills weren't what I thought they were (although they very much have become so now), and (2) Django had a slight learning curve, which wasn't difficult if I could sit down and work with it for more than 15 minutes at a time. Now I'm sold on developing everything with the framework. It's full featured, robust, and takes a lot of the guesswork out of web application development without adding too much magic (*cough cough*rubyonrails*cough cough*). After working with it, I feel I spend about 70% of my time working with XHTML/CSS and 30% of my time actually writing code, but that is to be expected, because, well, I'm not a designer, I'm a developer.

I did run into one snag on deployment however, and that was handling media. You see, Django has a simple dev server, much like Ruby on Rails, which allows you to start the process of Django development without setting up an entire LAMP stack. The dev server is part of the whole "rapid application development" idea, and, although I was initially wary of anything differing from my deployed environment, I bit the bullet and used the dev server. With the dev server, I set up my MEDIA_URL to be /media from the root of the server. This worked great using the url dispatcher, but once I deployed, I wanted my media to be found at media.theironlion.net, which made things interesting. In fact, for a few hours, The Iron Lion didn't have any styles, graphics, or javascript running. A quick stop in the #django IRC channel on Freenode got my pointed in the right direction. Initially, it was suggested that I create my own RequestContext. However, upon reading up on RequestContext, which is a subclass of the Context class, I found that Django had a context processor for the exact thing I needed (django.core.context_processors.media). A few small code changes were needed for the very few views that are actually publicly accessible (I count 5 currently). A small template change to the "base.html" template, and we were off to the races once again! However, this broke the admin interface, so it required me to also add django.core.context_processors.auth to the mix as well. Voila! Everything is back to functional!

Welcome to The Iron Lion -- Welcome to yet another coding blogger...

No comments have been posted yet.
Comments are now closed an archived posts.