django-urls-sugar 0.1.4

A library for making complex urls in Django easier
django-urls-sugar is a Django app that aims to make defining complex urls in django easier.

It provides a `patterns' method that extends the django.conf.urls.defaults functionalities, allowing to define more complex structured urls.

Its implementation takes inspiration from [django-templatetags-sugar](http://github.com/alex/django-templatetag-sugar).

Usage

In order to use django-urls-sugar you just need to slightly alter your urls.py files, using the redefined patterns (which just extends the default one, allowing you to define usual urls as well). For example:

```python
from django.conf.urls.defaults import url
from urls_sugar import patterns, url_sugar, Constant, Variable

urlpatterns = patterns('',
    url('^home$', home_view, name='home'),
    url_sugar([Constant('page'),
               Variable('pk', '\d+'),
              ], page_view, name='page'),
    ...
```


This two urls will handle

```
/home/
/page/(?P< pk >\d+)/
```

last updated on:
February 25th, 2012, 2:39 GMT
price:
FREE!
homepage:
github.com
license type:
BSD License 
developed by:
Stefano Parmesan
category:
ROOT \ Internet \ Django Plugins
django-urls-sugar
Download Button

In a hurry? Add it to your Download Basket!

user rating

UNRATED
0.0/5
 

0/5

Rate it!

Add your review!

SUBMIT