I've been meaning to migrate my website from Drupal to Django for a very long time. Although Drupal is an excellent content management system, I got tired of working with PHP every time I wanted to add a feature or make a change. My previous web host didn't support Python so I had to stick with PHP. Recently however, I moved the website to a VPS at Linode and decided to migrate to Django as well.
Writing a blog application in Django took very little time thanks to the reusable apps that come with Django, like syndication, comments and admin. I also had to port the blog design to Django templates and migrate the content from HTML to Markdown. I've been using Markdown at StackOverflow and I really like it. It's concise, readable and much easier to work with in a text editor than HTML. I wrote a small script to convert existing articles from the subset of HTML that I was using to Markdown.
To run the website, I'm using Apache2/mod_wsgi for the backend, and nginx as a frontend. I chose mod_wsgi because it's very flexible. As for nginx, I chose it because it integrates nicely with StaticGenerator, a Django middleware that caches pages as files on local disk. StaticGenerator has an important advantage over using Memcached with Django: cached pages are served by nginx without hitting Django at all, so it's much faster. A quick benchmark on my setup showed that it was 8 times faster. StaticGenerator can only cache full pages, but this is fine for my needs.
The blog feed now contains full articles (as opposed to short summaries). This should be more convenient to those who read the blog via the feed.












Comments
Abd Allah Diab
Way to go Ayman :D
I read your book and learned how to develop Django applications. I have also published the Django Bookmarks application online. I have also developed a middle ware to get online users. I really love Django and Python.
Thank you for your book, and congratulations for the migration :)
Posted at 5:33 p.m. on April 26, 2010
anonymous Howard
Thanks
Posted at 11 a.m. on April 28, 2010
Scott Morse
I admire your blog. I am a slow learner of Ubuntu, python, and web dev. The information here is relevant. You have a gift for clear expression. You seem humble. Thus the content is inviting. Thanks for your contributions here. I live in San Marcos, Texas, U.S.A.
Posted at 8:11 p.m. on April 28, 2010
Ayman Hourieh
ananymous Howard,
Thanks for your comment.
Posted at 11:51 p.m. on April 28, 2010
Ayman Hourieh
Scott,
I appreciate your comment. I'm glad to know that you find the content relevant. Thanks for your feedback, and I hope that you will enjoy future posts as well. :)
Posted at 11:56 p.m. on April 28, 2010
Ayman Hourieh
Abd,
You've added a nice template to the bookmarking application. It looks much nicer. Your online users middleware also looks interesting. Keep up the good work!
Posted at 12:02 a.m. on April 29, 2010