-
Notifications
You must be signed in to change notification settings - Fork 103
Django nvd3 Heroku
Matt Harley edited this page Apr 10, 2015
·
4 revisions
But here's a simple way to do it...
pip install django-nvd3 django-bower
pip freeze > requirements.txt
git add .
git commit -m "don't forget your requirements.txt!"
heroku config:set BUILDPACK_URL=https://github.com/ddollar/heroku-buildpack-multi.git
# ./.buildpacks
https://github.com/heroku/heroku-buildpack-nodejs.git
https://github.com/amanjain/heroku-buildpack-python-with-django-bower.git
# ./package.json
{"private": true,"dependencies": {"bower": "1.4.1"}}
# ./bin/post_compile
# install bower components
./manage.py bower_install
# settings.py
...
import os
APPLICATION_DIR = os.path.dirname(globals()['__file__'])
HEROKU = bool(os.environ.get('DATABASE_URL'))
BOWER_COMPONENTS_ROOT = os.path.join(APPLICATION_DIR, 'components')
# where to find your local bower
BOWER_PATH = '/usr/local/bin/bower'
if HEROKU:
BOWER_PATH = '/app/node_modules/bower/bin/bower'
BOWER_INSTALLED_APPS = (
'd3#3.3.13',
'nvd3#1.7.1',
)
...