1

I'm having some troubles deploying this app on Heroku. The code is on a folder, where i created a git using git init, added everything to my git and then pushed everything to Heroku before running it.

I generated my requirements.txtand my procfile looks like this:

test: python "application.py" heroku ps:scale web=1

But on my webpage nothing will load, i'm assuming because i'm only running the Python part. How can i deploy it so that Heroku will know to run not only my Python script, but also the frontend part with the javascript and index.html files?

Jack022
  • 867
  • 6
  • 30
  • 91

1 Answers1

1
  1. For development, you can serve static files with Flask.
  2. For production, use cloud CDN (like Amazon's or Google's) or add a web-server to your app (Nginx or Apache or whatever).
Fine
  • 2,114
  • 1
  • 12
  • 18
  • For developing i'm using a virtual environment, so that i can test my dynamic webapp on my browser, i'm trying to use Heroku to see what's the outcome when deployed online! – Jack022 Oct 23 '18 at 15:23
  • Sorry for the newbie question, is it easier to deploy it and have my app running on a normal page online with CDN rather than with Heroku? – Jack022 Oct 23 '18 at 15:24
  • 1
    Heroku is for a dynamic content (i.e. applications, Flask in your case) and CDN is for a static content. They are not mutually exclusive, but are working together. General case: on route '/' Flask returns rendered index.html containing links to JS, CSS and images, that are located on a CDN. Alternative to a CDN would be your own web-server in front of Flask app to serve static on Heroku. – Fine Oct 24 '18 at 08:31