blog Setting up the new 'staticfiles' app on Django 1.3.
Even if I've been using Django 1.3 for a while now, I've been holding off on some of it new features, such as the new way to handle static files via a new app called (guess what) staticfiles . Essentially, what the new static app does is allowing you to leave all static files within the /static directory of each of the django apps you're using. This is for development; when you're deploying and (most likely) want these files to be served via a (faster) separate server process, the staticfiles app helps you gather all of them into a predefined directory by using a handy shell command.
blog Django B_project available on gitHub.
UPDATE 2021-10-21: the code and project resources mentioned in this post have been archived
blog DJFacet: a faceted browser for Django.
DJFacet is a pluggable module for the Django web application framework that allows you to navigate the data in your webapp using an approach based on 'facets'. DJFacet relies entirely on the django models you've already defined within your project and on a configuration file where you can create the facets and assign them behaviour. This makes it very easy to integrate within your Django application.
blog Python links (and more) 7/2/11.
This post contains just a collection of various interesting things I ran into in the last couple of weeks... they're organized into three categories: pythonic links, events and conferences, and new online tools. Hope you'll find something of interest!
blog Setting up Django Registration.
Django's admin framework includes the basic functionalities for logging in and out of the admin site, but if you're building a so-called 'social' application and want people to be able to sign-up, log in and thus benefit from additional site functionalities then you need to use a more generic 'registration' application. The good news is: most of the work has already been done, so it's just a matter of putting things together correctly.
blog Preloading stuff in django's interactive shell.
Django's shell is a fantastic way to interact with all the components of your django application, eg when testing new functionalities or debugging a nasty error. Sometimes though you end up loading the same variables or importing the same modules every time you run the shell , for example because you are trying out a large function that needs being refined through a trial and error process.
blog Trying out Django-cms.
I tried installing django-cms, an open-source project from Switzerland's company Divio. It is a content management system based on the web framework Django and is written in Python.
blog The power of django's Q objects.
I've been spending some time today doing research on how to best use django's Q objects. Then I did a bit of testing myself and decided to put this whole thing together for future's sake, you know, for the time when I'll find myself lost and in need some coding recipe.
blog DjangoCon Europe 2010.
DjangoCon returned for its second year in Europe; the first as a wholly community-supported conference. The conference website contains a lot of info and interesting links (even an iPhone app), but in my opinion the coolest thing is the freely available videos of the conference!
blog Django debug toolbar.
Django Debug Toolbar 0.8 from Idan Gazit on Vimeo.
blog Creating Questionnaires with Django.
Simple and useful application from Aperte: Django Questionnaire. The Django Questionnaire app allows you to easily set up a working questionnaire, complete with email-invitations and CSV export functionality. This app allows you to spread your questions over multiple pages (categories), and currently supports 4 types of answers.
blog Django signals.
This is a really cool feature of django that I've never explored, so I though I'd made a post about it so to remind myself of using it more often! It's discussed extensively in the docs here and here. In a nutshell:
blog Django 1.1: LogOut links apparently broken.
I lost quite a few hours on this, but the solution was simple. The other day I realized that all the Log-in / Log-out hyperlinks in the admin were messing things up in various ways.
blog UML to django.
Neat little project that will speed up your data modeling using django: think up an application model, formalize it by drawing a UML diagram using the freely available ArgoUML, and have it tranlsated into django models automatically.
blog Autocomplete in Django #2.
[Update 14/09/11 : If you're using Django 1.3 you can also skip point -4- below, as the 'cut' filter is included in Django by default now!] [Update 15/2/10 : I added a small example that shows how to make this work with Inlines too, see point 6 below...] [Update 18/10/09 : please note that the code has been tested on django1.1! Check the comments below if you're running 1.0...] In a previous post I was talking about using autocomplete fields in django's admin, and how this feature was missing for inlines. I sorted this out and put together an essential bunch of files you can easily include in your project to that purpose. Nothing final or too wonderful but just a hack that'll get you going...
blog Using jquery's autocomplete in Django's admin: what about 'inlines'?.
I still haven't solved this problem entirely, and I'll tell you why. The issue has been discussed by many people, but probably the first and most influential solution is still Jannis Leidel's 'An autocomplete form widget for ForeignKey model fields'.
blog Project: django SOCLONE.
Just wanted to flag up SO-Clone, an interesting project on googleCode that wants to replicate the fundamental functionalities of Stack Overflow.
blog Using Django-MPTT: lessons learned....
Here we are again with Django and MPTT 0.3 (I already have other posts about it). After working with it for a bit I realized that things were breaking mysteriously, and only recently understood why that happened, so I thought I'd share this pearl of wisdom. Essentially this has to do with the way tree-elements must be created if you want the usual tree-navigation methods (e.g. get_descendants or get_ancestors) to work as expected.
blog Weird 'example.com' urls appearing on my django site....
It all started when I added the get_absolute_url method on my model objects:
blog MySQL-Python and Apple OSX 10.5 (Leopard).
UPDATE 30/12/09 : Snow Leopard and most recent versions of MySQL-python have broken the recipe below: you'd better check this blog post for an updated version (it worked for me). In a nutshell, the new method involves using the Macports installation if you're on Leopard, or specifying your 64-bit architecture during the compile process if you're on Snow Leopard... but if you're still getting errors, there's nothing else to do than invoking the almighty google for help . .
blog Django admin and MPTT #2.
This is a follow up to the previous post on managing and visualizing trees using django. I've been using MPTT quite a bit now and it's great - also, I looked deeper into the admin integration (basically, the issue of being able of manage trees from within the admin).
blog Representing hierarchical data with Django and MPTT.
Apparently, you've got two options for managing hierarchical data in django - django-mptt and django-treebeard.
blog Snippet to load stuff quickly in the Django shell.
Sometimes you end up testing out things a lot using the handy django shell, but every time you've got to repeat the same commands to load all the necessary models, utils etc. etc.
blog Offline django docs.
An offline copy of the django docs can be quite helpful if you find yourself doing development work without an internet connection. Obviously, django comes with its docs that you can generate (provided you have Sphinx and build tools). However sometimes a pdf is the handiest solution... here're some useful links I found: Docs in CHM and PDF formats: http://charupload.wordpress.com/2007/12/02/django-documentation-chm/