Metadata-Version: 2.0
Name: Flask-Pushrod
Version: 0.3
Summary: Views for your API
Home-page: http://github.com/UYSio/flask-pushrod
Author: Juan Matthys Uys
Author-email: opyate+flaskpushrod@gmail.com
License: MIT
Platform: any
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Environment :: Web Environment
Classifier: Framework :: Flask
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Dist: Werkzeug (>=0.7)
Requires-Dist: Flask (>=0.10.1)
Requires-Dist: future

Flask-Pushrod
=============

.. image:: https://secure.travis-ci.org/UYSio/Flask-Pushrod.png
   :alt: Build Status
   :target: http://travis-ci.org/UYSio/Flask-Pushrod

Flask-Pushrod is a simple helper for Flask for doing content negotiation (primarily for running the API and the website on the same code-base, with as little separate handling as possible).

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

Flask-Pushrod is available on PyPI, so to install the latest stable version simply run

::

    pip install Flask-Pushrod

or

::

    easy_install Flask-Pushrod

Usage
-----

A simple hello world app in Pushrod would look like this::

	from flask import Flask, render_template
	from flask.ext.pushrod import Pushrod, pushrod_view

	import random


	app = Flask(__name__)
	Pushrod(app)


	@app.route("/")
	@pushrod_view(jinja_template="hello.html")
	def hello():
	    return {
	        'greeting': random.choice(("Hi", "Heya"))
	    }

	if __name__ == "__main__":
	    app.run()

This would, depending on the request, return either the greeting message in JSON or render it through the Jinja2 `hello.html` template.

Tests
-----

::

$ tox


Documentation
-------------

More advanced documentation `is available on Read The Docs <http://flask-pushrod.rtfd.org/>`_.


