Creating an app on Heroku with Django and NPM Creating an app on Heroku with Django and NPM heroku heroku

Creating an app on Heroku with Django and NPM


If you want to avoid maintaining a custom buildpack, you can use the multi buildpack.

Using the multi buildpack is super simple:

  1. Run heroku config:add BUILDPACK_URL=https://github.com/ddollar/heroku-buildpack-multi.git
  2. Create a .buildpacks file in the root of your repository with two lines:https://github.com/heroku/heroku-buildpack-nodejs.git
    https://github.com/heroku/heroku-buildpack-python.git
  3. Create a package.json file with your npm dependencies.
  4. Run npm install


Note: The multi buildpack is a much nicer way to accomplish this these days :)


I've created a fork of the official Python heroku buildpack that allows an optional npm_requirements.txt for installing such dependencies.

I am now using coffeescript and less-css with django-compressor on heroku :)

https://github.com/jiaaro/heroku-buildpack-django

Edit: To switch to my buildback from the standard buildpack:

  1. use the heroku command line app to set the BUILDPACK_URL environment variable:

    heroku config:add BUILDPACK_URL=git://github.com/jiaaro/heroku-buildpack-django.git 


You can create your own buildpack, that mix nodejs buildbpack and python buildpack. Or compile your CoffeeScript on your machine and put it on S3.