Giter Club home page Giter Club logo

wepush's Introduction

WePush

微信推送通知服务(WeChat notification service)

一、环境

  • Ubuntu 16.04
  • Python 2.7

二、部署

1. 检查Python环境

  确保Python2.7和pip9.0.1左右

python -V
pip -V

2. 上传项目并安装依赖软件库

sudo pip install -r requirements.txt

3. 安装和配置nginx

  安装和配置过程省去。

4. 安装和配置supervisor

  让supervisor管理进程,可以在进程发生意外的情况下,自动重启服务。

5. 配置文件

  从 settings.examples.py 拷贝一份 settings.py

cp settings.examples.py settings.py

  编辑配置文件。

vim settings.py

  设置如下几个参数:

SECRET_KEY = '新建Django项目会自动生成SECRET_KEY'

DEBUG = False

WECHAT_TOKEN = '填写你的令牌(Token)'
WECHAT_APPID = '填写你的开发者ID(AppID)'
WECHAT_APPSECRET = '填写你的开发者密码(AppSecret)'

6. 启动nginx和supervisor

  启动前创建几个目录。

# nginx需要
sudo mkdir -p /var/log/nginx/
sudo mkdir -p /var/log/nginx/access/
# supervisor需要
sudo mkdir -p /var/log/supervisor/
# 该django项目需要,和static目录平级
sudo mkdir -p /var/log/uwsgi/
sudo chmod 777 /var/log/uwsgi/
sudo mkdir -p /var/run/uwsgi/
sudo chmod 777 /var/run/uwsgi/
mkdir all_static_files

  启动网站前初始化一下,首先进入 wepush 目录,执行下列命令

python manage.py makemigrations
python manage.py migrate
python manage.py compilemessages
python manage.py collectstatic
python manage.py project_helper/createsuperuser

  测试运行,前台启动服务并访问网站测试。

python manage.py runserver 0:8080

7. 登录微信公众平台进行一些设置

  过程省去。

8. 启动nginx和supervisor

  过程省去。

三、主要更新记录

  • 2019.11.13
    • 功能实现:对接微信公众平台接口测试帐号

四、参考链接

wepush's People

Contributors

wenyuan avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.