0

This is a very simple question, but I can't seem to manage to do it. I have created a python server script that we will call server_main.py. On GitHub, it is stored in a folder which we will call A.

I tried putting the script in the master branch directly, and when I did web: python server_main.py in the Procfile file, everything works fine.

Now, when I try to run the server_main.py that is in the folder A, I can't do it... I tried this:

web: python A/server_main.py

and

web: python A\server_main.py

But that didn't work. Is there a specific way to do this?

Thanks in advance :)

FireGreeks
  • 83
  • 1
  • 11
  • 1
    `web: cd A && python server_main.py` – Tin Nguyen Apr 07 '20 at 14:17
  • @Tim Nguyen I still get an error: "No web processes running" – FireGreeks Apr 07 '20 at 14:22
  • 1
    That's a different error. That error comes up after running the script successfuly for 30 seconds. Which means your original statement that it was running fine is wrong. If you are not running a web server change it to `worker: cd A && python server_main.py` – Tin Nguyen Apr 07 '20 at 14:24
  • Ohhh! Thank you! This has completely derailed from my original question but now, when I try to POST or GET with the deployed server, I get an HTTP Error 503: Service Unavailable. Do you know what it may come from? – FireGreeks Apr 07 '20 at 14:31
  • 1
    You are running a web server then. You need to change `worker` back to `web` and at the part where you are specifying the port you need to do `import os` `os.environ.get("PORT", 80)` where `80` would be the default port when no `$PORT` was specified. Heroku sets a `$PORT` value. – Tin Nguyen Apr 07 '20 at 14:35
  • I already had that. Hmmm. This is really bugging me! Thanks for helping, I think I understand this process a bit better now. I don't know if this has anything to do with it, but I thought something was very weird: in Ressources, under Dynos on the Heroku website, it is said that "This app has no process types yet Add a Procfile to your app in order to define its process types". But I DO have a Procfile file at the root of my GitHub... Maybe it has something to do with it? – FireGreeks Apr 07 '20 at 14:46

0 Answers0