Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.3 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Internet > Django Plugins

    django-urls-sugar 0.1.4

    Download button

    No screenshots available
    Downloads: 117  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Stefano Parmesan | More programs
    BSD License / FREE
    February 25th, 2012, 02:39 GMT
    ROOT / Internet / Django Plugins

     Read user reviews (0)  Refer to a friend  Subscribe

    django-urls-sugar description

    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+)/
    ```



    Product's homepage

    Requirements:

    · Python
    · Django

      


    TAGS:

    Django URL | complex URLs | define URLs | Django | URL | complex

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM