Skip to content

Instantly share code, notes, and snippets.

@leewardbound
Forked from anonymous/bootstrap.sh
Created June 2, 2011 20:50
Show Gist options
  • Save leewardbound/1005287 to your computer and use it in GitHub Desktop.
Save leewardbound/1005287 to your computer and use it in GitHub Desktop.
Django on Heroku with Celery and Sentry
virtualenv --no-site-packages .
source bin/activate
bin/pip install Django psycopg2 django-sentry
bin/pip freeze > requirements.txt
bin/django-admin.py startproject mysite
cat >.gitignore <<EOF
bin/
include/
lib/
EOF
echo
cat >> mysite/settings.py <<EOF
INSTALLED_APPS = INSTALLED_APPS + (
'django.contrib.admin',
'django.contrib.admindocs',
'indexer',
'paging',
'sentry',
'sentry.client',
)
MIDDLEWARE_CLASSES = MIDDLEWARE_CLASSES + (
'sentry.client.middleware.Sentry404CatchMiddleware',
)
EOF
cat > Procfile <<EOF
web: bin/python mysite/manage.py runserver 0.0.0.0:\$PORT --noreload
worker: bin/python mysite/manage.py celeryd -E -B --loglevel=INFO
EOF
cat >> mysite/urls.py <<EOF
urlpatterns += patterns('',
url(r'^sentry/', include('sentry.urls')),
)
from django.contrib import admin
admin.autodiscover()
urlpatterns += patterns('',
url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
url(r'^admin/', include(admin.site.urls)),
)
EOF
git add .
git commit -m 'startproject'
git push heroku master
heroku run bin/python mysite/manage.py syncdb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment