Django nvd3 Heroku

Matt Harley edited this page Apr 10, 2015 · 4 revisions

Bit of a pain!

But here's a simple way to do it...

Use django-nvd3 and django-bower

pip install django-nvd3 django-bower
pip freeze > requirements.txt
git add .
git commit -m "don't forget your requirements.txt!"

Use a multi-buildpack

heroku config:set BUILDPACK_URL=

Use the Node and Python buildpacks together

# ./.buildpacks

Download bower using npm

# ./package.json
{"private": true,"dependencies": {"bower": "1.4.1"}}

User django-bower to collect its assets

# ./bin/post_compile
# install bower components
./ bower_install

Tell django where to find bower

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'

    BOWER_PATH = '/app/node_modules/bower/bin/bower'