Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot run Django heroku app locally on Windows

So, I want to test my app locally, but something goes wrong. After installing virtualenv, activating it, installing requirements.txt and running collectstatic I try to run app with

heroku local web -f Procfile.windows

I get

[OKAY] Loaded ENV .env File as KEY=VALUE Format

And that's all. I wait for about 30 mins and then stop execution. Then I get

16:07:33 web.1   |  Unhandled exception in thread started by <function check_errors.<locals>.wrapper at 0x042BEF60>
16:07:33 web.1   |  Traceback (most recent call last):

Traceback is empty. This is all output. Sometimes, when I wait for about only 1-2 minutes no messages appear at all.

File Procfile.windows looks like:

web: python manage.py runserver 0.0.0.0:5000

What's wrong? Why this exception occurs?

like image 600
Konstantin K. Avatar asked Aug 12 '17 13:08

Konstantin K.


1 Answers

I'm also having the same issue; however, I noticed that the procfile command IS being run, but heroku is swallowing the console output. Which means if there is an error in the django code, the server silently does not start.

I can run manage.py runserver manually to see the console output, but that means having to configure the .env variables separately (which I'd rather not do, as I have multiple Heroku/Django apps locally).

However, for some reason, if I save any project file (even with no changes) while the server is running, the console output starts to appear as expected

like image 54
Landric Avatar answered Sep 25 '22 23:09

Landric