# 配置.baserc文件 sudo vi ~/.baserc # 输入以下内容 if [ -f /usr/local/bin/virtualenvwrapper.sh ];then export WORKON_HOME=~/.virtualenvs export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3 source /usr/local/bin/virtualenvwrapper.sh fi
# 切换到Python虚拟环境 mkvirtualenv new_project
5.从 GitHub 下载项目以及安装项目所需依赖
1 2
git clone 仓库地址 pip install -r requirements.txt
6.配置 nginx 服务器
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
# 修改Nginx的配置文件 vi /etc/nginx/sites-available/default # 替换至以下内容 listen 80; server_name 127.0.0.1; location / { # First attempt to serve request as file, then # as directory, then fall back to displaying a 404. # try_files $uri $uri/ =404; proxy_pass http://127.0.0.1:8000; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } location /static { alias /home/yorun/sites/demo.xiaohuo.com/xiaohuo/static; }