Helps start your Django project based on HTML5 Boilerplate templates and optimisation build system
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


This project is still in it's early stages, so if you come across something that is broken, please let me know. Patches, improvements and other feedback is most welcome.

This project allows you to easily start a Django project based on the amazing HTML5 Boilerplate template and build system (

When looking for similar projects on the web, I found a few that incorporated the template of HTML5 Boilerplate but none that would allow you to make use of the build system for optimisation. More can be read about the build system at but basically it will combine and minify your JavaScript and CSS files, optimize JPEG and PNG images, minify your HTML and revises file names of resources so you can make use of very long expire times on your server. You should make sure you understand most of what HTML5 Boilerplate is about before trying to make too many modifications.

The django-html5-boilerplate project initially only contains two Python scripts which are described below. These scripts will be available on your virtualenv's path if you install via python install or pip install <package>.


  • Python 2.x
  • Java JRE or JDK
  • Ant (1.8.2)
  • Pip
  • (Django and HTML5 Boilerplate will be downloaded when startproject is run)


This is equivalent to Django's startproject command so use it with your intended project name as an argument to begin your project. You are advised to start off in a clean virtualenv with no Django project created yet. Read more about virtualenv and virtualenvwrapper at and

  • Downloads Django if necessary
  • Makes a new Django project with the name of your choice using startproject
  • Downloads HTML5 Boilerplate and extracts it
  • Moves HTML5 Boilerplate HTML, CSS and images into your new project under templates and static directories
  • Sets up the HTML5 Boilerplate installation to build from your Django project


This is run when you are about to deploy to a server. This may take a minute or more to run as it is using html5boilerplate's Ant build optimisations. When buildproject has run, the optimised version of static is in a separtate directory called static_publish and the same goes for templates. Running your server in production mode with DEBUG=False will cause the optimised templates to be used by and you should configure your webserver to serve static_published at the /static/ URL. The build process uses staticfiles which is new in Django 1.3. This should mean that static content from INSTALLED_APPS should also get collected together and optimised. If you're wondering why static is not called media, Django now recommends media is just used for user-uploaded content. Read more here:

  • Runs HTML5 Boilerplate's Ant build script to compress your Django HTML templates, JavaScript, CSS and Images
  • Moves the compressed output files into static_publish and templates_publish.
  • Your original HTML template, JavaScript, CSS and Image files are kept in their original location for future editing and still used when DEBUG=True.