Skip to main content

Weixin for Flask.

Project description


.. image::
.. image::

Flask-Weixin is the implementation for with the
flavor of Flask. It can be used without Flask too.


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()

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

* 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)

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

Project details

Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
Flask-Weixin-0.1.0.tar.gz (4.5 kB) Copy SHA256 hash SHA256 Source None Nov 6, 2013

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page