Skip to main content

django urls helper based on wsgi selector

Project description

django-selector is a custom url pattern parser for Django that is based off of Luke Arno’s Selector for WSGI. It is designed to simplify the writing and reading of url patterns by providing recipes for frequently used patterns. django-selector’s parser ignores classic regex based url patterns, so if you require the flexibility of regexes you needn’t jump through registration hoops for a one-off url pattern. Using these named patterns in your urls.py clarifies what they are matching as well as how they are matching it:

patterns('foo.views',
(r'^/(?P<name>[a-zA-Z0-9\-]+)/(?P<foos>\d*.?\d+)/$', 'index', {}, 'foo-index'))

becomes:

parser.patterns('foo.views',
(r'/{name:slug}/{foos:number}/', 'index', {}, 'foo-index'))

You can install django-selector with pip:

pip install django-selector

You can fork django-selector from its hg repository:

hg clone http://dev.jmoiron.net/hg/django-selector

You can also read the full current development documentation or the release documentation.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-selector-0.2.tar.gz (3.1 kB view details)

Uploaded Source

File details

Details for the file django-selector-0.2.tar.gz.

File metadata

File hashes

Hashes for django-selector-0.2.tar.gz
Algorithm Hash digest
SHA256 4ffe8c9d30d87e184d88d8a8e01cc906d8413004c30c0201af9ca82a85aaf7b1
MD5 4190f11e1040fd07265ddd86967018db
BLAKE2b-256 2f04192a44a74088293671b446ee77ddd9b6e10c1f6a8e04e34f6803ae02833d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page