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?

1 Answer 1

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).
Sign up to request clarification or add additional context in comments.

3 Comments

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!
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?
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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.