summaryrefslogtreecommitdiff
path: root/docs/index.rst
blob: b18c80038c4c61b5b86fbb3c0d795f1580b34f59 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
====================
Routes Documentation
====================

.. image:: routes-logo.png
    :width: 100px
    :height: 171px
    :align: left

Routes is a Python re-implementation of the Rails routes system for mapping URLs to application actions, and conversely to generate URLs. Routes makes it easy to create pretty and concise URLs that are RESTful with little effort.

Routes allows conditional matching based on domain, cookies, HTTP method, or a custom function. Sub-domain support is built in. Routes comes with an extensive unit test suite.

Installing
==========

Routes can be easily installed with pip or easy_install::
   
   $ easy_install routes

Example
=======

.. code-block:: python
   
   # Setup a mapper
   from routes import Mapper
   map = Mapper()
   map.connect(None, "/error/{action}/{id}, controller="error")
   map.connect("home", "/", controller="main", action="index")

   # Match a URL, returns a dict or None if no match
   result = map.match('/error/myapp/4')
   # result == {'controller': 'main', 'action': 'myapp', 'id': '4'}

Source
======

The `routes source can be found on GitHub <http://github.com/bbangert/routes>`_.

.. toctree::
   :maxdepth: 2
   
   introduction
   setting_up
   generating
   restful
   uni_redirect_rest
   changes

.. toctree::
   :maxdepth: 1

   glossary
   porting
   

Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`glossary`

Module Listing
--------------

.. toctree::
    :maxdepth: 2

    modules/index