django+uwsgi+nginx+postgresql备忘
安装pg创建数据库xxx设置用户密码111111
apt-get install postgresql
su - postgres
psql
create database xxx;
alter user postgres with password '111111';
\c xxx;
\d
\q
exit
安装uwsgi和virtualenv
pip install virtualenv uwsgi
安装Python3环境
virtualenv -p python3 venv
激活进入venv
cd venv && source bin/activate && cd venv
安装Python库
pip install django==1.9 jinja2 xlrd pillow pypinyin psycopg2
uwsgi 配置
[uwsgi]
uid = root
gid = root
chmod-socket = 666
chown-socket = root:root
socket = /xx/proj.sock
chdir = /root/venv/app
module = proj.wsgi
home = /root/venv
chmod-socket = 666
env = DJANGO_SETTINGS_MODULE=proj.settings
master = true
processes = 1
vacuum = true
pidfile = /tmp/app
# uwsgi --reload /tmp/app