8 web design add-ons for Django

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.

3. django-compress

Optimization of CSS and Javascript distribution can greatly improve web client rendering times: django-compress outputs concatenated and minified files and handles smart client-side caching.

4. django-userskins

Using django-userskins you can enable user-selected themes in your application.

5. django-tabs

For your navigation bar, you can use django-tabs to highlight active tab (possibly with multiple navigation layers), by combining Django template extension mechanism and a special template tag.

6. django-reversetag

Default url tag is quite primitive, but using reverse tag introduce by django-reversetag, you can resolve urls from variables and string literals, which is very useful if your view or named view is computed at run-time.

7. macros template tags

Django macros template tags help you apply DRY criterias in your templates, while maintaining separation between presentation and logic. Download macros.py and save it into your app’s templatetags folder.

8. smart_if template tags

smart_if template tag add-on replaces default if/else/endif tags with a custom version that allows basic yet useful value comparisons. Download smart_if.py and save it into your app’s templatetags folder.

Tip: original smart_if doesn’t support elif syntax. You can find amended version here.

Related posts:

  1. Django dynamic template paths
  2. Integrate Wordpress and Django
  3. Integrate Tornado in Django
Add to StumbleUpon Add to del.icio.us Add to Mixx!     
  • RyanBalfanz
    Thanks!
  • Hi Ozan, thanks for pointing out. I will update my post asap.
  • It's worth pointing out the functionality of the smart_if tag has been incorporated into the `if` tag for 1.2 (see http://docs.djangoproject.com/en/dev/releases/1...)
  • AJ
    I've been using django-compress and it works well, however it's annoying that you need to list the css/js files in your settings.py. A web designer should be able to define the css/js right in the template. That's why I've recently switched to django_compressor (http://github.com/carljm/django_compressor). Has the same feature set, but the css/js can stay in the templates, and it's also actively being developed.
  • @codysoyland: thanks for your suggestions. Will try them asap :-)
  • codysoyland
    Good overview of some various options. I'd like to recommend a couple of other webdesign-related tools. One is Typogrify: http://jeffcroft.com/blog/2007/may/29/typogrify...

    Another thing I'd like to recommend for template designers is django-template-repl (shameless self-promotion). This makes it easier to debug template tags: http://www.codysoyland.com/2009/dec/13/django-t...
blog comments powered by Disqus