public
anonymous / bootstrap.sh
Last active

Django on Heroku with Celery and Sentry

  • Download Gist
bootstrap.sh
Shell
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
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

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.