Django project layout for Heroku

By: José Padilla

At Blimp we love working with Django. We use it for almost all of our projects, including Blimp and -M.

In Django 1.4, the startproject and startapp commands came with a new template option. Specifying this --template option lets you use a custom project directory structure for your project from a path or URL. By default when you run the startproject management command, it creates a Django project directory structure that contains and a project package (containing a and other files) based on this default template.

We decided to create a project template with the things we always end up doing on our Django projects. This template has a couple of useful settings and Fabric commands that make deploying, managing, and using Django with Heroku easier.

How to install startproject --template= --extension=py,md,dev project_name

What’s included?

  • Fabric – Fabric is a Python library and command-line tool for streamlining the use of SSH for application deployment or systems administration tasks.
  • South – schema and data migrations for Django
  • dj-database-url – Django utility allows you to utilize the DATABASE_URL environment variable to configure your Django application.
  • django-extensions – Custom management extensions for the Django
  • gunicorn – Simply implemented, light on server resource usage, and fairly speedy Python WSGI HTTP Server.
  • psycopg2 – PostgreSQL database adapter for Python

Fabric Script
Fabric is definitely the easiest way to execute local and remote shell commands. We’ve created quite a few of these to help with deployment, database management, and Heroku, all aware of the environment, so for example, you can easily run database migrations in development, staging, or production.

You can keep track of the project on GitHub. Follow me (jpadilla) on GitHub.

33 projects that make developing django apps awesome

There are many reasons why I like developing web applications with Python and Django but the main one is the awesome community and projects around the language and framework. Every time I search for something there’s always a Django or Python project available to make my life easier.

Here’s an incomplete list of Python and django related projects that I have used or I’m planning to test. This might help someone starting out to get an idea of how awesome is to work with this technologies.

Django Debug Toolbar
The Django Debug Toolbar is a configurable set of panels that display various debug information about the current request/response and when clicked, display more details about the panel’s content.

South brings migrations to Django applications. Its main objectives are to provide a simple, stable and database-independent migration layer to prevent all the hassle schema changes over time bring to your Django applications.

Django Paypal
Django PayPal is a pluggable application that implements with PayPal Payments Standard and Payments Pro.

Django Avatar
A reusable django application for handling Avatars.

Shameless plug. I made this. It deploys django apps to Amazon EC2 with ONE command.

Django Exceptional
A Django client for Exceptional (

Django Easy Maps
This app makes it easy to display a map for given address in django templates. No API keys, manual geocoding, html/js copy-pasting or django model changes is needed.

Django Extensions
It provides a plethora of useful commands, and a couple other little goodies as well.

Django-based platform for rapidly developing websites

Django CMS
A Django application for managing hierarchical pages of content, possibly in multiple languages and/or on multiple sites.

Django Sentry
Sentry provides you with a generic interface to view and interact with your error logs. By default, it will catch any exception thrown by Django and store it in a database.

Django Haystack
Haystack provides modular search for Django. It features a unified, familiar API that allows you to plug in different search backends (such as Solr, Whoosh, Xapian, etc.) without having to modify your code.

Django Celery
Provides Celery integration for Django; Using the Django ORM and cache backend for storing results, autodiscovery of task modules for applications listed in INSTALLED_APPS, and more.

Piston is a relatively small Django application that lets you create application programming interfaces (API) for your sites.

Creating delicious APIs for Django apps since 2010.

Django social authentication made simple.

Django Social Registration
Django Social Registration enables developers to add alternative registration methods based on third party sites. Supported methods currently are: OpenID, OAuth, Facebook Connect.

Django Basic Apps
Simple prebuilt applications for Django projects.

Django forms are easily rendered as tables, paragraphs, and unordered lists. However, elegantly rendered div based forms is something you have to do by hand. The purpose of this application is to provide a simple tag and/or filter that lets you quickly render forms in a div format.

Django-filter is a reusable Django application for allowing users to filter queryset dynamically.

Simple tagging for django

A Django blog engine leveraging reusable apps for all its features.

A drop in replacement for Django’s built-in runserver command. Features include: An extendable interface for handling things such as real-time logging. Integration with the werkzeug interactive debugger. An improved runserver allowing you to process requests simultaneously.

FeinCMS is an extremely stupid content management system. It knows nothing about content — just enough to create an admin interface for your own page content types. It lets you reorder page content blocks using a drag-drop interface, and you can add as many content blocks to a region (f.e. the sidebar, the main content region or something else which I haven’t thought of yet). It provides helper functions, which provide ordered lists of page content blocks. That’s all.

A calendaring/scheduling application, featuring: one-time and recurring events, calendar exceptions (occurrences changed or cancelled), occurrences accessible through Event API and Period API, relations of events to generic objects, ready to use, nice user interface, view day, week, month, three months and year and project sample which can be launched immediately and reused in your project.

An extension to the Django web framework that provides comprehensive version control facilities.

A reusable Django app for queuing the sending of email

Many sites need to notify users when certain events have occurred and to allow
configurable options as to how those notifications are to be received. The project aims to provide a Django app for this sort of functionality. This
includes: submission of notification messages by other apps, notification messages on signing in, notification messages via email (configurable by user) and notification messages via feed.

A set of utilities for creating robust pagination tools throughout a django application.

Other not django specific projects that help me with web development

Flask is a microframework for Python based on Werkzeug, Jinja 2 and good intentions.

Supervisor is a client/server system that allows its users to monitor and control a number of processes on UNIX-like operating systems.

Gunicorn ‘Green Unicorn’ is a Python WSGI HTTP Server for UNIX. It’s a pre-fork worker model ported from Ruby’s Unicorn project.

Fabric is a Python (2.5 or higher) library and command-line tool for streamlining the use of SSH for application deployment or systems administration tasks.