Hello there, I am facing issues with my project when I turn the DEBUG = False. I have the Apache configured correctly (as I know) but still it is not working. Please can anyone provide for me an template of how Apache should look like and I can just make experiments based on it until I’ll find a way? Thank you for your time, I am waiting for a reply!
Welcome @Brigli-The-Coder !
First, you will need to be a lot more specific than just saying “still it is not working”. Please describe in detail what isn’t working. It may also help move things along if you actually posted what your configuration is, and what commands you’ve issued to set this up. (Don’t just describe the command, show the actual commands used that are relevent to your question.)
There is no one “template” that is guaranteed to work in all situations. There are too many variables involved to provide a generic answer.
Also, ensure that you have read all the docs at:
Thank you, this will end up being helpful.
But you still haven’t provided a description of what isn’t working, nor shown any error messages or log files describing the problem you’re seeking assistance with.
Side note: When you post code here, please enclose the code between lines of three backtick - ` characters. This means you’ll have a line of ```, then your code, then another line of ```. This forces the forum software to keep your code properly formatted. (I’ve taken the liberty of fixing your original post for you.)
Also, in the general case, you do not want your Django project directory to be within the “public Apache” directories. You want your actual code to be somewhere else - perhaps in /opt
or within a directory in /home
.
Again, you still haven’t described what isn’t working for you, nor have you posted any Apache log files showing any errors.
soory I forgot to write send them, but here they are:
[Thu Sep 19 19:01:54.198560 2024] [proxy:error] [pid 63240:tid 140470252463872] (111)Connection refused: AH00957: HTTP: attempt to connect to 127.0.0.1:8000 (localhost) failed
[Thu Sep 19 19:01:54.198595 2024] [proxy_http:error] [pid 63240:tid 140470252463872] [client XX.XXX.XX.XXX:53387] AH01114: HTTP: failed to make connection to backend: localhost, referer: http://your-server-ip:60/
[Thu Sep 19 19:03:45.731303 2024] [proxy:error] [pid 63241:tid 140471116486400] (111)Connection refused: AH00957: HTTP: attempt to connect to 127.0.0.1:8000 (localhost) failed
[Thu Sep 19 19:03:45.735290 2024] [proxy_http:error] [pid 63241:tid 140471116486400] [client XX.XXX.XX.XXX:53410] AH01114: HTTP: failed to make connection to backend: localhost
[Thu Sep 19 19:06:21.347720 2024] [proxy_http:error] [pid 63241:tid 140471348500224] (20014)Internal error (specific information not available): [client XX.XXX.XX.XXX:53422] AH01102: error reading status line from remote server localhost:8000
[Thu Sep 19 19:06:21.348395 2024] [proxy:error] [pid 63241:tid 140471348500224] [client XX.XXX.XX.XXX:53422] AH00898: Error reading from remote server returned by /
[Thu Sep 19 19:06:21.426517 2024] [proxy:error] [pid 63241:tid 140471373678336] (111)Connection refused: AH00957: HTTP: attempt to connect to 127.0.0.1:8000 (localhost) failed
[Thu Sep 19 19:06:21.426574 2024] [proxy_http:error] [pid 63241:tid 140471373678336] [client XX.XXX.XX.XXX:53422] AH01114: HTTP: failed to make connection to backend: localhost, referer: http://your-server-ip:60/
You’ve deleted your earlier post with the settings. We will need to see them to continue trying to diagnose this. Also, these errors don’t appear to be consistent with either your original description or with the image you posted. (And, it’s probably going to be helpful to see the access log for these requests as well.)
As a debugging step, I’d suggest stopping Apache, deleting the log files to help avoid getting things mixed up, then restarting Apache and retrying your test.
You might also want to try testing it with a “private” or “incognito” window to avoid cache-related issues.