Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

Weixin for Flask.

Project Description
Flask-Weixin
============

.. image:: https://travis-ci.org/lepture/flask-weixin.png?branch=master
:target: https://travis-ci.org/lepture/flask-weixin
.. image:: https://coveralls.io/repos/lepture/flask-weixin/badge.png?branch=master
:target: https://coveralls.io/r/lepture/flask-weixin

Flask-Weixin is the implementation for http://mp.weixin.qq.com/ with the
flavor of Flask. It can be used without Flask too.

Installation
------------

You can install Flask-Weixin with pip::

$ pip install Flask-Weixin

Or, with setuptools easy_install in case you didn't have pip::

$ easy_install Flask-Weixin


.. module:: flask_weixin

Get Started
-----------

Eager to get started? It is always the Flask way to create a new instance::

from flask_weixin import Wexin

weixin = Weixin(app)

Or pass the ``app`` later::

wexin = Weixin()
wexin.init_app(app)

However, you need to configure before using it, here is the configuration
list:

* WEIXIN_TOKEN: this is required
* WEIXIN_SENDER: a default sender, optional
* WEIXIN_EXPIRES_IN: not expires by default

For Flask user, it is suggested that you use the default view function::

app.add_url_rule('/', view_func=weixin.view_func)

@weixin.register('*')
def reply(**kwargs):
username = kwargs.get('sender')
sender = kwargs.get('receiver')
content = kwargs.get('content')
return weixin.reply(
username, sender=sender, content=content
)

The example above will reply anything the user sent. You might be
interesting in the :meth:`Weixin.reply` method.


Without Flask
-------------

Developer Interface
-------------------

This part of the documentation covers the interface of Flask-Weixin

.. autoclass:: Weixin
Release History

Release History

History Node

0.5.0

History Node

0.4.1

History Node

0.4.0

History Node

0.3.0

History Node

0.2.0

This version
History Node

0.1.0

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
Flask-Weixin-0.1.0.tar.gz (4.5 kB) Copy SHA256 Checksum SHA256 Source Nov 6, 2013

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting