Tuesday 23 July 2013

Heroku - Django Project Startup

settings.py
Troubleshooting for dj-static (In case static files error)
OSError: [Errno 2] No such file or directory: '/app/PROJECT_NAME/static'
heroku run python manage.py collectstatic --dry-run --noinput
wsgi.py
Procfile
runtime.txt
requirements.txt

Related Cmd

ssh-keygen -t rsa
# Generate ssh pub key (id_rsa)
ssh -v git@github.com
# Check your default .pub location for troubleshooting 
# Make sure both files included in the directory (id_rsa & id_rsa.pub)

heroku login
heroku keys
heroku keys:remove xxx@xxx

git init
echo local_settings.py>> .gitignore
# Remember to exclude local_settings.py in .gitignore
More info: https://devcenter.heroku.com/articles/gitignore
git add .
git commit -m 'Initial commit'

git remote -v
git remote rm heroku
More info: https://devcenter.heroku.com/articles/git

heroku create APP_NAME OR heroku git:remote -a EXISTING_APP_NAME

git push heroku master

heroku addons | grep POSTGRES
heroku addons:add heroku-postgresql:dev
heroku pg:wait
heroku config | grep HEROKU_POSTGRESQL
heroku pg:promote HEROKU_POSTGRESQL_XXX_URL
# Replace XXX with info from heroku config
More info: https://devcenter.heroku.com/articles/heroku-postgresql

heroku open

heroku run python manage.py syncdb
heroku run python manage.py migrate APP
heroku run python manage.py shell

More info: https://devcenter.heroku.com/articles/django

No comments :

Post a Comment