Python Daily
2.57K subscribers
1.48K photos
53 videos
2 files
38.9K links
Daily Python News
Question, Tips and Tricks, Best Practices on Python Programming Language
Find more reddit channels over at @r_channels
Download Telegram
django not logging errors to file when running on nginx

I'm running a django app with uwsgi and nginx. I'm trying to have to django log some 500 errors so I can debug an issue but for some reason it is not writing to the file I've specified when I access my app at its domain. The logging works fine when I manually test the app using uwsgi.

here's my nginx.conf

#nginx.conf
upstream django {
# connect to this socket
server unix:/tmp/uwsgi.sock; # for a file socket
#server 127.0.0.1:8001; # for a web port socket
}

server {

listen 80 default_server;
server_name mysite.org
return 301 https://$server_name$request_uri;

}

server {
# the port your site will be served on
#listen 80 default_server;
#listen 8000;

listen 443 ssl;

root /opt/apps/site-env/trust_site;

# the domain name it will serve for
server_name mysite.org


#Max upload size
client_max_body_size 75M; # adjust to taste

# Django media
location /media {
alias /opt/apps/site-env/site/media; # your
Django project's media files
}

location /static {
alias /opt/apps/site-env/site/static; # your Django
project's static files
}

location / {
uwsgi_pass django;

include /etc/nginx/uwsgi_params;

proxy_pass_header X-CSRFToken;
#proxy_set_header X-Forwarded-Proto https;
#proxy_set_header HOST $host;

}


}

help anyone?

/r/django
https://redd.it/6btiwt