To clone this repo:
git clone -b postgis-2.0-django-1.5 --single-branch git://github.com/cirlabs/django-project-templates.git
This project contains templates for creating a new Django project. It’s like running django-admin.py startproject but it creates a more complete application skeleton.
All you need to do is install the package from PyPi like so. Note that it will install PasteScript, Cheetah and Fabric. So you may want to create a new virtualenv.
python easy_install django-project-templates
Alternatively you can install it from a git clone with:
python setup.py install
And then creating a project skeleton is as simple as:
paster create --template=django_project example_project
Note that this project skeleton is still in flux. It definitely contains some things that are personal preference but it hopefully makes up for it with useful tools like a reasonably complete fabric based deployment setup and configs for CruiseControl. And yes, more documentation would be nice.
Drawing on work from the Chicago Tribune, we (the Center for Investigative Reporting) put together a project template for launching news apps in a Heroku environment. You can read more about it here.
paster create --template=heroku_project project_name
CIR app setup on a Mac (currently assumes PostGIS 1.x)
– Virtualenv and VirtualenvWrapper
– Postgres and PostGIS running locally
– Memcached/Libmemcached – https://gist.github.com/mikejcorey/6442295
– Homebrew will make your life easier for most of the above
– Heroku CLI and other tools: http://devcenter.heroku.com/articles/quickstart
Creating a new app
1. Create a new virtual environment:
2. Check out our fork of django-project-templates:
git clone git://github.com/cirlabs/django-project-templates.git cd django-project-templates python setup.py install cd ..; rm -rf django-project-templates
3. Create a new Heroku template:
paster create --template=heroku_project example
4. Bootstrap the environment:
cd example; fab bootstrap
5. Re-log in to virtualenv:
deactivate; workon example
At this point, you can start developing locally. Remember: Put your static media in the “assets” folder, not the “static” folder, which is used by Django’s static files framework to collect and serve static media locally.
Deploying to Heroku:
1. Set up app for Heroku:
2. Deploy data to data server:
fab production deploy_data
3. Deploy static media to S3:
fab production deploy_static
4. Deploy app to Heroku:
git push heroku master