-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
60 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
安装virtualenv: | ||
|
||
sudo pip install virtualenv | ||
|
||
创建虚拟环境: | ||
|
||
virtualenv wechat_env | ||
|
||
# 激活虚拟环境 | ||
|
||
source wechat_env/bin/activate | ||
|
||
# 安装依赖包 | ||
|
||
pip install -r requirements.txt | ||
|
||
# 直接运行 | ||
|
||
python manage.py runserver | ||
|
||
# 生产环境下supervisor + gunicorn + ngix | ||
|
||
参考 | ||
[http://beiyuu.com/vps-config-python-vitrualenv-flask-gunicorn-supervisor-nginx/](http://beiyuu.com/vps-config-python-vitrualenv-flask-gunicorn-supervisor-nginx/) | ||
|
||
+ 配置appId, appsecret, Token | ||
+ 按微信官方教程配置服务器地址 | ||
+ 配置Debug | ||
+ 配置logger | ||
+ 配置STATICFILES_DIRS, TEMPLATES | ||
+ 此处没有涉及数据保存,生产环境下要配置好MySql,Redis等 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,9 @@ | ||
defusedxml==0.4.1 | ||
Django==1.9.5 | ||
django-debug-toolbar==1.4 | ||
djangorestframework==3.3.3 | ||
djangorestframework-xml==1.3.0 | ||
gunicorn==19.4.5 | ||
sqlparse==0.1.19 | ||
wheel==0.24.0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
|
||
{% extends 'base.html' %} | ||
|
||
{% block title %} | ||
哦哦,发生了错误 | ||
{% endblock title %} | ||
{% block main %} | ||
<div class="weui_msg"> | ||
<div class="weui_icon_area"><i class="weui_icon_msg weui_icon_warn"></i></div> | ||
<div class="weui_text_area"> | ||
<h2 class="weui_msg_title">微信服务发生了错误</h2> | ||
<p class="weui_msg_desc">请再次尝试或联系管理员</p> | ||
</div> | ||
</div> | ||
|
||
{% endblock main %} |