First, warm up your system.
$ easy_install pip
$ pip install virtualenv
$ pip install django
$ gem install heroku
Start a project.
$ django-admin.py startproject [myproject]
$ cd !$
Setup virtualenv and start it up.
$ virtualenv --no-site-packages ve
$ source ve/bin/activate
(ve
for virtualenv isn't that nice and terse? You can call it whatever you want.)
Create a requirements.txt
file and put this stuff in it.
Django
psycopg2
south
(psycopg2 is a PostgreSQL adapter for Python.)
While you're still inside of your virtualenv, load your requirements.
$ pip install -r requirements.txt
Put south
in your INSTALLED_APPS
in settings.py
.
INSTALLED_APPS = (
'south',
...
Make .manage.py
executable (so you don't have to type python manage.py ...
all the time).
$ chmod +x manage.py
Don't forget to add ve
to your .gitignore
file.
Now go make something awesome.
$ heroku create --stack cedar
$ git push heroku master
$ heroku run python manage.py syncdb
$ heroku open
Update your database with South and push the changes to Heroku
- Make changes to your models
$ ./manage.py schemamigration [appname] --auto
$ ./manage.py migrate [appname]
- [commit & push changes to heroku]
$ heroku run ./manage.py migrate [appname]
This is a Solutions Log post.