django 热启动_阿里云搭建django+nginx+uwsgi环境

本文详细介绍了如何在阿里云上搭建Django环境,包括更新源、安装nginx、切换Python3为默认版本、创建虚拟环境、配置uwsgi和nginx,最后实现Django应用的热启动。通过这一系列步骤,确保了服务的稳定运行。
摘要由CSDN通过智能技术生成

阿里云搭建django环境

更新源

sudo apt-get update

sudo apt-get upgrade

安装nginx

sudo apt-get install nginx

sudo /etc/init.d/nginx start (start可以改成restart/stop)

#或是sudo service nginx start

然后浏览器输入服务器IP,观察是否有welcom to nginx!

安装py3和virtualenv

sudo apt-get install git python3 python3-pip

sudo pip3 install virtualenv

修改python版本:

法一:(不建议)

$ gedit ~/.bashrc #gedit .bash_aliases

在顶部加入一行alias python=python3

$ source ~/.bashrc #或是source ~/.bash_aliases o

$ python --version

就会发现是Python 3.5.2啦

/*or

Open your .bashrc file nano ~/.bashrc. Type alias python=python3 on to a new line at the top of the file then save the file with ctrl+o and close the file with ctrl+x. Then, back at your command line type source ~/.bashrc. Now your alias should be permanent.

*/

▲.切换Python

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值