Z
Z
zasqer2014-08-14 18:35:15
Django
zasqer, 2014-08-14 18:35:15

How to install bower components on Heroku for Django project?

There is a Django project. I want to install jquery and bootstrap on heroku using bower.
I try like this:
package.json

{
  "dependencies": {
      "bower": "*"
  },
  "scripts": {
      "postinstall": "bower install"
  }
}

bower.json
{
  "name": "app",
  "version": "0.0.0",
  "authors": [
    "Name <[email protected]>"
  ],
  "license": "MIT",
  "ignore": [
    "**/.*",
    "node_modules",
    "bower_components",
    "static/components",
    "test",
    "tests"
  ],
  "dependencies": {
    "jquery": "~2.1.1",
    "bootstrap": "~3.2.0"
  }
}

Judging by the logs from Heroku, the build is successful, but when I try to enter the site, I see this: "Application Error"
And in the logs, instead of Python app detected, I see Node.js app detected
Apparently Heroku thinks that I have a Node.js project, t .to. there is a package.json file. But I can't remove package.json, I need it to install bower.
Attention to the question: what to do? :)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
sakuradaj, 2014-08-16
@sakuradaj

Use https://github.com/ddollar/heroku-buildpack-multi
by adding:

https://github.com/heroku/heroku-buildpack-nodejs.git
https://github.com/heroku/heroku-buildpack-python.git

bower should be installed, I'm not sure about the automatic installation of bower things.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question