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
and 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
1fab staging deploy
A little experiment: If you find this post and ad below useful, please check the ad out :-)