Django: March 2008 Archives

UPDATE: This post has been updated so the code will work with Django 1.0

While working on Clapton, the Django-based Content Management System (CMS), I had to write validation code for file uploads. This is needed because Clapton contains applications specific to media types such as documents which requires Word Documents, PDFs or OpenDocumentFormat files, and podcasts which requires MP3 or OGG files. But how do you guarantee that the right files are uploaded? By using Django's custom fields and newforms module.