Cannot run Django heroku app locally on Windows
Asked Answered
C

1

6

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?

Chert answered 12/8, 2017 at 13:24 Comment(5)
Why are you stopping the server? What are you expecting to happen?Colored
Can we see more code? Is it just a hello world application?Quintile
@DanielRoseman, because there's no point in waiting longer, as it should start within a few seconds.Chert
@User, yes it is.Chert
But still I don't understand what you are expecting to see on the console. Did you try actually accessing the local server? Does it work?Colored
R
2

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

Racehorse answered 5/11, 2018 at 16:45 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.