1辽幌、DisallowedHost at /admin Invalid HTTP_HOST header: '119.45.124.33:8011'. You may need to add '119.45.124.33' to ALLOWED_HOSTS.
解決方法:
修改項(xiàng)目中的 setting.py 文件
ALLOWED_HOSTS = ['*'] #在這里請求的host添加了*
2、E45: 'readonly' option is set (add ! to override)
解決方案毒坛, :wq!
強(qiáng)制關(guān)閉文件后慨灭,在命令行里輸入:sudo !!
后回車亏栈。
3溉浙、** Operational MODE: preforking+threaded *** failed to open python file wsgi.py unable to load app 0 (mountpoint='') (callable not found or import error) *** no app loaded. going in full dynamic mode ***
上述報錯是由于uwsgi.ini 配置文件中的項(xiàng)目路徑配置錯誤導(dǎo)致
chdir 是項(xiàng)目的絕對路徑
wsgi-file 是wsgi.py相對于chdir路徑的相對路徑
例如:新建Django項(xiàng)目Test芋忿,絕對路徑是 /home/user_001/Test炸客,wsgi.py的路徑是 /home/user_001/Test/Test/wsgi.py 疾棵。
那么配置如下:
chdir = /home/user_001/Test
# 注意Test前不要加 /
wsgi-file = Test/wsgi.py
4、Job for nginx.service failed because the control process exited with error code. See "systemctl status nginx.service" and "journalctl -xe" for details.
一般是etc/nginx/nginx.conf 配置不符合規(guī)則痹仙,使用 sudo nginx -t
檢查
5是尔、# nginx: [emerg] “server” directive is not allowed here
etc/nginx/nginx.conf 的配置中,server需要放在http里面
events {
...
}
http {
...
server {
...
}
}