python django uwsgi nginx安装
已安装完成python/django的情况下安装
pip install uwsgi
cd /usr/share/nginx/html/
vim uwsgi.ini输入以下内容-------------------------------------------------------------
#uwsgi.ini file
[uwsgi]
# Django-related settings
# the base directory (full path)
chdir = /usr/share/nginx/html #manage.py所以目录
# Django's wsgi file
module = project2.wsgi:application #应用程序project2下的wsgi文件
# the virtualenv (full path)
#home = /path/to/virtualenv
# process-related settings
# master
master = true
# maximum number of worker processes
processes = 3
# the socket (use the full path to be safe)
#socket = /home/myself/myself.sock
socket = 127.0.0.1:8000 #以8000端口提供socket服务
# ... with appropriate permissions - may be needed
chmod-socket = 666
chown-socket = nginx:nginx
# clear environment on exit
vacuum = true
enable-threads = true
运行为cd /usr/share/nginx/html/
uwsgi --ini ./uwsgi.ini
yum install nginx
cd /etc/nginx/
vim nginx.conf输入以下内容-------------------------------------------------------------
upstream django {
server 127.0.0.1:8000;
}
location /static/ {
root /usr/share/nginx/html;
}
location / {
include uwsgi_params;
uwsgi_pass django;
}
cd /etc/systemd/system/ vim uwsgi.service
[Unit]
Description=uWSGI Emperor
After=syslog.target
[Service]
ExecStart=/usr/bin/uwsgi --emperor /usr/share/nginx/html
Restart=always
KillSignal=SIGQUIT
Type=notify
StandardError=syslog
NotifyAccess=all
[Install]
WantedBy=multi-user.target
setting.py中加入
STATIC_ROOT = '/usr/share/nginx/html/static/'
python manage.py collectstatic
systemctl restart uwsgi.service
systemctl restart nginx.service
systemctl enable uwsgi.service
systemctl enable nginx.service

python django uwsgi nginx安装的更多相关文章

  1. Cenos(6.6/7.1)下从源码安装Python+Django+uwsgi+nginx到写nginx的环境部署(一)

    梳理下这几个的关系: centos是redhat的社区版操作系统. Python2.7.5是开发语言(centos6.5下自带的python是2.6.6版本,所以需要源码更新,而centos7.1下面 ...

  2. Python+django+uWSGI+Nginx

    Python3.5+Django+uWSGI 安装Django pip3.5 install django 安装 uWSGI pip install uwsgi 新建 django_wsgi.py # ...

  3. centos7 nginx配置httpsCenos(6.6/7.1)下从源码安装Python+Django+uwsgi+nginx环境部署(二)

     1.yum安装nginx 下载对应当前系统版本的nginx包(package) # wget  http://nginx.org/packages/centos/7/noarch/RPMS/ngin ...

  4. Django+uwsgi+Nginx安装部署

    安装 安装Nginx Nginx是最流行的高性能HTTP服务器. 安装pcre: wget https://sourceforge.net/projects/pcre/files/pcre/8.37/ ...

  5. python+django+wusgi+nginx安装部署

    基于centos搭建nginx+uwsgi运行django环境 环境: CentOS 7 nginx/1.9.12 Python 2.7.5 一:安装依赖包5 yum install zlib-dev ...

  6. virtualvenv+django+uWSGI+nginx 部署

    原创博文 转载请注明出处! 1. virtualvenv 2. django 3. uWSGI 4. nginx 5. 踩坑记录 1. virtualvenv virtualvenv install ...

  7. Linux 集群概念 , wsgi , Nginx负载均衡实验 , 部署CRM(Django+uwsgi+nginx), 部署学城项目(vue+uwsgi+nginx)

    Linux 集群概念 , wsgi , Nginx负载均衡实验 , 部署CRM(Django+uwsgi+nginx), 部署学城项目(vue+uwsgi+nginx) 一丶集群和Nginx反向代理 ...

  8. Django+uWSGI+Nginx 部署网站

    Django 1.11设置 保证Django在本地调试没有问题: 当然这是前提^_^ 收集静态文件至指定文件夹 Django静态文件设置具体参考:https://docs.djangoproject. ...

  9. django+uWSGI+nginx的工作原理流程与部署过程

    django+uWSGI+nginx的工作原理流程与部署过程 一.前言 知识的分享,不应该只是展示出来,还应该解释这样做是为什么... 献给和我一样懵懂中不断汲取知识,进步的人们. 授人与鱼,不如授人 ...

随机推荐

  1. localStorage 存储 数组

    let str = JSON.stringify(data.list); localStorage.setItem("options",str); let optionss=loc ...

  2. [LeetCode] 167. Fraction to Recurring Decimal 分数转循环小数

    Given two integers representing the numerator and denominator of a fraction, return the fraction in ...

  3. iOS-UIToolbar与UISearchBar

    组件_ UIToolbar  /** 1. 顶部toolbar 2. TextField可以以UIBarButtonItem的自定义视图的方式加入toolbar 3. 三个按钮 4. 将UIBarBu ...

  4. Unity3D 原来Unity比较新的版本支持中文

    注意: Unity 2018.2 以上版本才可以

  5. 基于Jquery ui 可复用的酒店 web页面选择入住日期插件

    效果图: 代码: <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" ...

  6. jquery换一批的写法

    jquery换一批的写法 <pre> <img src="{$yuming}/images/3/huanyipi.png" alt="" cu ...

  7. 封装一个Model或者Vender类

    Model <?php /** * User: Eden * Date: 2019/3/21 * 共有内容 */ class WxPayModel extends Model { protect ...

  8. 如何解决error: failed to push some refs

    $ git push -u origin master To github.com:a653398363/testtest.git ! [rejected] master -> master ( ...

  9. CentOs7环境下手动配置JDK7

    下载: JDK7下载地址:http://www.oracle.com/technetwork/java/javase/downloads/java-archive-downloads-javase7- ...

  10. springcloud超简单的入门3--负载均衡

    上个文章的末尾说到,当有多个服务实例的时候,怎样来获取服务实例.但是,只是简单的通过get(0)来获取列表中的第一个实例来使用. 现实场景中,还需要写一个算法来实现负载均衡来决定每次使用的服务实例,而 ...