Our Journey to a blog with django - Part 1: The Requirements
At the very beginning of our blog, we had to decide if we are going with a self written bloglike system or a mature existing one. After some discussion a self written was out of scope back then and so i evaluated a few blog systems and finally settled with serendipity. But it was a compromise as most of the software were to bloated with stuff we probably never use and complicated to adjust our needs (php sucks :-) ) or imho had a bad software design. Lately we got bugged to much and in particular i had the idea of redesigning the site again and didn't feel like learning to customize s9y. That was the resurrection of writing an own system. It was clear from the beginning it has to be with python and django as we both were very pleased with the concept and working of this combo. So i did some research if someone has already done this and found some solutions with the most interesting by Dave. Hes offering his source via svn so one can look how he did it. I took a look and found it straight forward, which got me started playing around for a while.
Later i wrote my requirements down and decided to blog about our journey to a django blog. This is the first part and i am going to talk about our requirements and some first ideas.
What do we need?
- plain simple, no fancy stuff
- easy integration of existing designs. I'd like to take a plain template from http://www.oswd.org/ , http://www.opendesigns.org/ , http://www.free-css-templates.com/free-templates.html , http://www.freecsstemplates.org/ or any of the other thousand sites and just convert it in some steps.
- XHTML compliance
- content writing with a markup syntaxand hopefully no xhtml inline
- tagging of articles/content
- different content type as articles and static pages
- rss or atom feed
- contact form
- possibility to enter comments (not a must)
- code highlighting
The decisions for the main points so far:
For the previous trial i used this template and i will settle with this one. Its "code" is clean and easy to port to django templates. I'll split it up into a base template for the whole frame, an article overview and the article detail view. And using as much inheritance as possible. thanks to django templates :-)
The feed part seems to be pretty forward with django and is described here. Nothing to worry about.
I know theres a bunch out there and personally i like the one of dokuwiki the most, but its out of scope to write an own parser. I took a look at the most common in the pyhon world, ReST, textile and markdown. After a short discussion with Kerim, it was clear we both couldn't stand ReST neither textile, but felt comfortable with markdown, markdown did win.
Currently we aren't using it really or better its no visual at moment (due design), but it should stay. At least for a bit better formating then the pre tag. As i already did some experiments with pygments i've been looking if someone has already integrated it with django or even better with markdown. And thanks to django snippets i found a snippet, that already integrates those three.
In the django contrib package theres already a comment app, but its not well documented and not flexible at all. For example you need to hack it if you'd like to add some fields to the comment forms. Otherwise its quite easy to install and use. Dave did a good job at summing this task up. On the other hand i'm not sure if we even need this as most people aren't commenting here. BTW thanks to the few who did :-) I'll keep this decision open until the end.
Already learned any lessons during play time?
i got hit twice with some problem, the first one did cost me several hour of searching and not seeing the error, i just overlooked a damn ^ in my urls config for the blog app. The result was that my regexp for the url mapping did not work and i was wondering why some stuff did not work.
The second one is not really a problem as i got the django comment system really quickly working. But i didn't like how the comments work and that there are no hooks yet to just add some new simple fields. I know the django crew is reworking it, so lets be surprised. Maybe i can use it later or otherwise i have to write my own.
Next time we are going to define our model as much as necessary for the first coding steps.
comments powered by Disqus