Hello All,
I have recently be trying to launch a production website using Django, Python,
uWSGI, and NGINX on a CentOS 7 server. Currently, I cannot get uWSGI to talk to
python. Here are a few more details:
Operating System: CentOS7
CPU architecture: Four core
Webserver: NGINX
uWSGI version: 2.0.13.1
Python 3.4.4
Django 1.9.7
Attached are my config files.
When I run uWSGI in emperor mode and I go the website address
www.xerase.corp.peer1.net<http://www.xerase.corp.peer1.net> I get the basic
HTML code rendered but calls such as {% load staticfiles %} are ignored and
therefore the static files are not being rendered. I believe this is a uWSGI
issue as I cannot get uWSGI to connect to python. I have tried commands such
as: uwsgi --socket xerase.sock --wsgi-file test.py but when I go to the site
in my browser it times out and does not render the test.py file.
For some reason I cannot figure out, uWSGI is not working as expected.
If you have any suggestions, please provide them.
Thank you in advance for your time,
Alex McGregor
This email and any attachments are confidential and intended for the recipient
only. If you have received this message in error, please notify the sender
immediately, destroy this email and any attachments, and do not use, copy,
store and/or disclose to any person this email and any attachments.
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;
events {
worker_connections 1024;
}
http {
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
worker_connections 1024;
}
http {
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
include /etc/nginx/mime.types;
default_type application/octet-stream;
include /etc/nginx/sites-enabled/*.conf;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
include /etc/nginx/mime.types;
default_type application/octet-stream;
include /etc/nginx/sites-enabled/*.conf;
server_names_hash_bucket_size 64;
# Load modular configuration files from the /etc/nginx/conf.d directory.
# See http://nginx.org/en/docs/ngx_core_module.html#include
# for more information.
include /etc/nginx/conf.d/*.conf;
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name _;
root /home/amcgregor/xerase_env/xerase/templates/degauss;
# Load configuration files for the default server block.
#include /etc/nginx/default.d/*.conf;
error_page 404 /404.html;
location = /40x.html {
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
}
}
}
# xerase_nginx.conf
# the upstream component nginx needs to connect to
upstream django {
server unix:///home/amcgregor/xerase_env/xerase/xerase/xerase.sock; # for a
file socket
#server 127.0.0.1:8001; # for a web port socket (we'll use this first)
}
# configuration of the server
server {
# the port your site will be served on
listen 80;
# the domain name it will serve for
server_name 10.121.21.228; # substitute your machine's IP address or FQDN
charset utf-8;
# max upload size
client_max_body_size 75M; # adjust to taste
location /static {
/home/amcgregor/xerase_env/xerase; # your Django project's static files
- amend as required
}
# Finally, send all non-media requests to the Django server.
location / {
uwsgi_pass django;
include home/amcgregor/xerase_env/xerase/uwsgi_params; # the
uwsgi_params file you installed
}
} # xerase_uwsgi.ini file
[uwsgi]
# Django-related settings
# the base directory (full path)
chdir = /home/amcgregor/xerase_env/xerase/
# Django's wsgi file
module = xerase.wsgi
# the virtualenv (full path)
home = /home/amcgregor/xerase_env/
virtualenv = /home/amcgregor/xerase_env
# process-related settings
# master
master = true
# maximum number of worker processes
processes = 10
# the socket (use the full path to be safe
socket = /home/amcgregor/xerase_env/xerase/xerase/xerase.sock
# ... with appropriate permissions - may be needed
chmod-socket = 666
# clear environment on exit
vacuum = true
enable-threads = true
_______________________________________________
uWSGI mailing list
[email protected]
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi