I have 3 files:
webapp.py => simple flask app that with every GET requests reads stock.txt and shows it content
scrapper.py => simple bs4 scrapper that scraps a site every 5 minutes and saves its stock to a file stock.txt
stock.txt => stores the stock from scrapper.ppy
I have no problem running it on my local pc but i dont know how to deploy it to heroku
I cant find an simple answer on heroku docs
CodePudding user response:
Well you'll find a lot of problems if you are not familiar with Heroku in the first place.
In heroku you have to build your procfile and with this configure your webapp, clock and jobs.
Example Procfile
for a web application:
web: gunicorn webapp:app
Example Procfile
for a clock (scheduled job):
clock: python scarpper.py
And with the last one you have some serious problem because Heroku have a virtual instance of you code so modifications to your repository files will not be persisted. Maybe think of using a Database.
PD: You only need one procfile containing the deployment information.