#uwsgi.ini
[uwsgi]
chdir = /projects/finace_sys/financing_sys
module = financing_sys.wsgi
master = true
processes = 4
vacuum = true
socket = 0.0.0.0:8000
~
/etc/nginx/conf.d/xxx.conf
upstream django{
#listen the server
server 127.0.0.1:8000;
}
server{
#listen to
listen 80;
server_name 47.106.33.246;
charset utf-8;
client_max_body_size 100M;
location /static {
alias /projects/finace_sys/financing_sys/static;
}
location / {
uwsgi_pass django;
#include /etc/nginx/uwsgi_params;
include uwsgi_params;
}
}
/myprject/setting.py
添加:
import os
STATIC_ROOT = os.path.join(BASE_DIR, 'static')
——————————————————————————————
1.python manage.py collectstatics
2.重启nginx
3.重启uwsgi
[[reply_item.creator.str_verbose]] 回复 [[reply_item.reply_creator.str_verbose]]
[[reply_item.creator.str_verbose]]