M
M
mercmarcus2020-11-13 11:47:41
Python
mercmarcus, 2020-11-13 11:47:41

How to deploy Python script with .txt file to Heroku?

I have a parser script. The parser with an interval, for example, an hour, parses the site, collects links and uploads them to a .txt file. The next time it checks the site links with the .txt file and if there are new links, it fills them in .txt

postsFile = open('posts.txt','r+')
posts = postsFile.read().splitlines() 
postsFile.writelines(url+'\n')
postsFile.close()

Locally everything works fine. But Heroku is silent. What could be the reason for this? In different forums, some people talk about postgre, others say that Heroku has no problems with .txt databases. Don't know. What do i do?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alan Gibizov, 2020-11-13
@phaggi

There is no file system on Heroku. Store the collected data somewhere outside of Heroku.

A
ARKRAFTER, 2020-12-16
@ARKRAFTER

HEROKU CLI | HEROKU GIT

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question