Last year Wordpress got an award as best Open Source CMS software and the reason is clear: it’s easy to setup, low on resources, very customizable and full of useful extensions. So unless you have very specific deployment requirements and if your blog is not part of your core technology, you may get the best of both worlds by using Wordpress for blogging and use a web framework for everything else. Not reinventing the wheel is very important in post-agile world, after all.
Being a Django monkey, I’d like to share some tips on how to make Wordpress and Django live together: Read the rest of this entry »
Tornado is a nice python WSGI-compliant web server developed by guys at FriendFeed. It’s primarily thought as application server for python web frameworks and according to FriendFeed benchmarks, it’s blazing fast thanks to its non-blocking connections.
UPDATE: For more performance info, James Abley pointed me to a very complete benchmark of available Python asynchronous webservers. It looks like Tornado is a real monster of concurrency.
There are already some how-to’s on the web on plugging Django web framework into Tornado webserver. A quick recap:
A tutorial on Tornado, Django and nginx by Jeremy Bowers.
In the last year, I’ve defined a quite stable fundation for my django projects. In this post I’m enumerating template design components that saved my day by reducing development time while keeping code readable, concise and standard-compliant.
1. Blueprint CSS framework
While not a django-specific add-on, Blueprint CSS framework is a perfect companion for django template designers: it features cross-browser style reset, a 24-column grid layout, a nice looking typography and a print-friendly style.
2. django-uni-form
django-uni-form implements UniForm CSS framework in Django: you can render your forms as stylish xhtml-compliant divs using a simple template tag filter and add form layout information to your Form classes.
If you’re keeping your django buildout installation under git, you may find the following .gitignore list useful to prevent your commits from cluttering with ugly temporary files (of course it also applies to other revision control system ignore files). You may need to adapt folder names to your buildout.cfg setup.
Several add-on applications for Django bring in their own templates and expect user to hardcopy those files into project’s template directory. The problem raises when add-on egg is updated and its hardcopied templates are not. Another approach could be to add add-on template directory path to TEMPLATE_DIRS variable in project’s settings.py. However, once add-on application is updated, hardcoded path may not be up-to-date.
UPDATE: Vinicius Mendes commented on using django.template.loaders.app_directories.Loader to solve the problem (a similar module exists for eggs, which is named django.template.loaders.eggs.Loader). It’s definitely the easiest way if you don’t mind importing all of your applications templates. Instead, if you need to pick only selected directories or non-standard directory names, keep on reading.
Using django 1.1.1 framework with dmigrations tool, I’ve discovered that they don’t honour mysql naming conventions correctly. In fact, mysql has a limit of 64 characters on table names, index names and column names, but django doesn’t take it into account when generating tables and indices from models.