Nginx+uWSGI部署Django

配置运行环境

pip install uwsgi
pip install django

配置uWSGI

vim uwsgi.ini
[uwsgi] 
socket = 127.0.0.1:8001
chdir = /www/wwwroot/django.pw
module = bookMan.wsgi:application 
env = DJANGO_SETTINGS_MODULE = bookMan.settings 
master = true 
processes = 4
vacuum = true 
uwsgi --ini uwsgi.ini #查看uwsgi的启动信息,若无报错,直接静默启动 -d
echo 'uwsgi -d --ini uwsgi.ini ' >> /etc/rc.local

配置Nginx

location / { 
        include uwsgi_params;
        uwsgi_pass 127.0.0.1:8001;
    }   
location /static {
        alias /www/wwwroot/django.pw/static;
    }

配置Django

ALLOWED_HOSTS = ['django.pw']
STATIC_ROOT = '/www/wwwroot/django.pw/static/' #在Setting添加
python manage.py collectstatic

暂无评论

发送评论 编辑评论


				
|´・ω・)ノ
ヾ(≧∇≦*)ゝ
(☆ω☆)
(╯‵□′)╯︵┴─┴
 ̄﹃ ̄
(/ω\)
∠( ᐛ 」∠)_
(๑•̀ㅁ•́ฅ)
→_→
୧(๑•̀⌄•́๑)૭
٩(ˊᗜˋ*)و
(ノ°ο°)ノ
(´இ皿இ`)
⌇●﹏●⌇
(ฅ´ω`ฅ)
(╯°A°)╯︵○○○
φ( ̄∇ ̄o)
ヾ(´・ ・`。)ノ"
( ง ᵒ̌皿ᵒ̌)ง⁼³₌₃
(ó﹏ò。)
Σ(っ °Д °;)っ
( ,,´・ω・)ノ"(´っω・`。)
╮(╯▽╰)╭
o(*////▽////*)q
>﹏<
( ๑´•ω•) "(ㆆᴗㆆ)
😂
😀
😅
😊
🙂
🙃
😌
😍
😘
😜
😝
😏
😒
🙄
😳
😡
😔
😫
😱
😭
💩
👻
🙌
🖕
👍
👫
👬
👭
🌚
🌝
🙈
💊
😶
🙏
🍦
🍉
😣
Source: github.com/k4yt3x/flowerhd
颜文字
Emoji
小恐龙
花!
上一篇
下一篇