Gunicorn with django giving 500 with no extra information

Question:

I am trying to run django 3.2.16 with gunicorn, I get this output in console:

[2023-01-15 23:45:39 +0100] [210935] [INFO] Starting gunicorn 20.1.0
[2023-01-15 23:45:39 +0100] [210935] [DEBUG] Arbiter booted
[2023-01-15 23:45:39 +0100] [210935] [INFO] Listening at: http://0.0.0.0:8000 (210935)
[2023-01-15 23:45:39 +0100] [210935] [INFO] Using worker: sync
[2023-01-15 23:45:39 +0100] [210936] [INFO] Booting worker with pid: 210936
[2023-01-15 23:45:39 +0100] [210935] [DEBUG] 1 workers

Everything looks like working, but when I go to localhost, I get Internal Server Error.

It kinda behaves like if I had DEBUG = False, but I have DEBUG = True and there is also nothing in console. Django setup finishes and I also verify, that settings.DEBUG is indded true:

My wsgi.py file:

application = get_wsgi_application()
print(settings.DEBUG)

And of course runserver works fine.

What else could that be? How to get some kind of error output? I tried capture-out and all the log files and levels that gunicorn provides but got nothing useful from the console.

Asked By: K.H.

||

Answers:

The reason was this line in my django log settings:

        "disable_existing_loggers": True,

Setting this to False fixed my problem.

Answered By: K.H.
Categories: questions Tags: , , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.