Flask-Via 2015.1.1
Provides a clean, simple URL routing framework for growing Flask Applications.
License: MIT
Keywords: Flask,Routing,Routes,URLs,Views

``Flask-Via``
=============

Inspired by the Django URL configuration system, ``Flask-Via`` is designed to
add similar functionality to Flask applications which have grown beyond a
simple single file application.

|travis| |coveralls| |downloads| |version| |license|

Example
-------

.. sourcecode:: python

    from flask import Flask
    from flask.ext.via import Via
    from flask.ext.via.routers.default import Functional

    app = Flask(__name__)

    def foo(bar=None):
        return 'Foo View!'

    routes = [
        Functional('/foo', foo),
        Functional('/foo/<bar>', foo, endpoint='foo2'),
    ]

    via = Via()
    via.init_app(app, route_module='flask_via.examples.basic')

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

Why?
----

Growing your application can be quite difficult when it's not always clear
where and how your routes are discovered. This can lead to a cluttered
application factory method when all your routes are defined at application
creation - resulting in code which is difficult to maintain, not to mention
messy.

A better solution is to define your routes in a ``routes.py`` and automatically
load them at application start up. This is what ``Flask-Via`` helps to do.

Third party Flask extensions don't always follow the same conventions for
adding routes to an application, so ``Flask-Via`` has been designed to be easy
for developers to write their own custom routers. For an example of this, take
a look at the bundled ``Flask-Restful`` Resource_ router.

If you do write a custom router that is useful to you, it will probably be
useful to someone else so please do contribute back :)

Links
-----

* Documentation: http://flask-via.thisissoon.com
* CI: https://travis-ci.org/thisissoon/Flask-Via
* Coverage: https://coveralls.io/r/thisissoon/Flask-Via?branch=master

.. |travis| image:: http://img.shields.io/travis/thisissoon/Flask-Via/master.svg?style=flat
    :target: https://travis-ci.org/thisissoon/Flask-Via
    :alt: Travis build status on Master Branch

.. |coveralls| image:: http://img.shields.io/coveralls/thisissoon/Flask-Via/master.svg?style=flat
    :target: https://coveralls.io/r/thisissoon/Flask-Via?branch=master
    :alt: Test Coverage

.. |downloads| image:: http://img.shields.io/pypi/dm/Flask-Via.svg?style=flat
    :target: https://pypi.python.org/pypi/Flask-Via
    :alt: Number of PyPI downloads

.. |version| image:: http://img.shields.io/pypi/v/Flask-Via.svg?style=flat
    :target: https://pypi.python.org/pypi/Flask-Via
    :alt: Latest PyPI version

.. |license| image:: http://img.shields.io/pypi/l/Flask-Via.svg?style=flat
    :target: https://pypi.python.org/pypi/Flask-Via
    :alt: MIT License

.. |health| image:: https://landscape.io/github/thisissoon/Flask-Via/master/landscape.png
   :target: https://landscape.io/github/thisissoon/Flask-Via/master
   :alt: Code Health

.. _Resource: http://flask-via.thisissoon.com/en/latest/api.html#flask_via.routers.restful.Resource

Change Log
==========

2015.1.1
--------
* Fix: Setup to allow bdist_wheel installs

2014.05.19.2
------------
* Improved: @joonathan added ``kwargs`` passing to the ``Blueprint`` Router
* Improved: ``init_app`` and added ``__init__``
* Added: Deprecation warning to ``Basic`` router

2014.05.19.1
------------
* Hotfix: Fixed issue where routes would be reregistered with an app
  incorrectly in the event of multiple app creations

2014.05.19
----------
* Feature: ``Include`` now supports ``endpoint`` prefixing
* Feature: Blueprint router can now take a blueprint instance
* Feature: Added support for ``VIA_ROUTES_NAME`` to set a common routes name
* Deprecated: ``Basic`` Router in favour of the ``Functional`` router
* Improved: ``Pluggable`` Router API is now cleaner
* Improved: Test Suite now uses PyTest
* Improved: ``ImproperlyConfigured`` now raised if routes module is not defined
  in either ``init_app`` or in application configuration via
  ``VIA_ROUTES_MODULE``

2014.05.08
----------
* Feature: Flask Admin Router
* Feature: Include ``url_prefix`` option

2014.05.06
----------
* Feature: Flask extension initialisation
* Feature: Basic and Pluggable Flask Routers
* Feature: Flask-Restful Router
* Feature: Ability to include other routes
* Feature: Ability to register blueprints