markdown Django Deploy Cpanel
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了markdown Django Deploy Cpanel相关的知识,希望对你有一定的参考价值。
Deploy
```
nano .ssh/authorized_keys
>paste our key generated by ssh-keygen in id_rsa.pub file
mkdir <app_directory>
cd <app_directory>
git clone git@bitbucket.org:<user_name>/<repo>.git
mv <repo> src
```
Set virtualenv
```
source /<app_directory>_src/bin/activate
cd /<app_directory>
pip freeze
pip install ...
```
Update and Restart Passenger WSGI from command line
```
cd <app_directory>/src
git pull origin master
selectorctl --interpreter ruby --user <user_name> --domain <domain_name> --restart-webapp <app/directory>
```
Create an update.sh file on remote server
```
#!/bin/bash
source virtualenv/django_src/3.4/bin/activate
cd django/src
echo Pulling git changes in server app.unioingenieros.net
echo
git pull
echo
echo Database Migration
echo
python manage.py migrate
echo
echo Restarting Passenger WSGI
echo
selectorctl --interpreter ruby --user appunioingeniero --domain app.unioingenieros.net --restart-webapp django/src
echo Done
```
Set exec privileges
```
chmod +x update.sh
```
create an update.cmd file in project
```
@echo off
ssh <username>@<server> './update.sh'
```
以上是关于markdown Django Deploy Cpanel的主要内容,如果未能解决你的问题,请参考以下文章
找不到模块'corsheaders' django/heroku deploy
Deploy Django in Windows
Django Elastic Beanstalk Deploy 显示 404
Deploy Django on Ubuntu 16.4 LTS
[django] Deploy Django Applications Using uWSGI and Nginx on Ubuntu 14.04
在 Google App Engine 上部署 Django ==> 错误:(gcloud.app.deploy)NOT_FOUND:无法检索 P4SA(...)