Skip to content

Easy django applications with cookiecutter

February 20th, 2014 - Software(1 min)

Now I’m trying to create a bunch of django applications and I’ve got tired of creating everything from scratch. So, here are the steps I’m using to easy create a new django app:

  • Create a new virtual environment. This is vital. It allows you to set up your own versions, not pollute the default installation (removing packages is tricky IMO). If you don’t know what I’m talking about, spend a few minutes to find out.

  • Install cookiecutter (pip install cookiecutter). This is according to some the best thing that happened since sliced bread. It’s a templating system that allows you to create a file structure from a template. You could think of it like using django’s templates system to generate your files.

  • Create your workspace (e.g. a directory to put the project in) and run:

    cookiecutter https://github.com/pydanny/cookiecutter-django.git

    Give it the right data (project name, your name …)

As dependencies, you’ll need:

  • PostgreSQL. If you’re on a mac, you can use PostgreSQL.app for easy install.

  • Node.js. Latest iteration of pydanny’s cookiecutter-django requires node to do things like media compression before deployment.

  • I also use fabric for deployment. It’s easy to just write:

    fab staging deploy

Enjoy

Share on
Reddit
Linked in
Whatsapp

A little experiment: