1.安装 Nginx
apt-get update
apt install Nginx-full
2.安装uwsgi
apt install uwsgi
3.安装pyenv
git clone https://github.com/pyenv/pyenv.git ~/.pyenv
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc
echo -e 'if command -v pyenv 1>/dev/null 2>&1; then\n eval "$(pyenv init -)"\nfi' >> ~/.bashrc
exec "$SHELL"
sudo apt-get install -y make build-essential libssl-dev zlib1g-dev libbz2-dev \
libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev \
xz-utils tk-dev
4.安装python3.6.1
pyenv install 3.6.1
pyenv gloabl 3.6.1
5.安装Postgresql数据库
- 创建文件
vim /etc/apt/sources.list.d/pgdg.list,
deb http://apt.postgresql.org/pub/repos/apt/ xenial-pgdg main
- 导入存储库签名密钥,并更新软件包列表
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | \
sudo apt-key add -
sudo apt-get update
- 安装
apt-get install postgresql-10
6.安装django
pip install django
pip install djangorestframework
pip install psycopg2 #postgresql数据库驱动