系统:KaLi 2016
软件:Python3.5,Django1.9
- 用户权限管理已经完成,released v1.0
- 考勤管理已经完成,released v1.0.1
- 克隆代码
cd /data/webroot
git clone https://github.com/hgz6536/opman-django.git
- 初始化项目
参考:http://blog.niubilety.com/2016/06/08/554.html
- 安装uwsgi
pip3 install uwsgi
- nginx配置文件
upstream opman {
server 127.0.0.1:8000;
}
server {
listen 80;
server_name opman.niubilety.com
charset utf-8;
gzip on;
gzip_min_length 1000;
gzip_buffers 4 16k;
gzip_http_version 1.1;
gzip_comp_level 3;
gzip_vary on;
client_max_body_size 8M;
#access_log /data/logs/nginx/opman_access.log;
#error_log /data/logs/nginx/opman_error.log;
location /medis {
alias /data/opman-django/media;
}
location /static {
alias /data/opman-django/static;
}
location / {
uwsgi_pass opman;
include /etc/nginx/uwsgi_params;
}
}
- 启动uwsgi
uwsgi --ini /data/webroot/opman-django/uwsgi.ini
- 启动nginx
/etc/init.d/nginx start
580838402