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数据库驱动
Logo

开放原子开发者工作坊旨在鼓励更多人参与开源活动,与志同道合的开发者们相互交流开发经验、分享开发心得、获取前沿技术趋势。工作坊有多种形式的开发者活动,如meetup、训练营等,主打技术交流,干货满满,真诚地邀请各位开发者共同参与!

更多推荐