Created
August 26, 2011 08:34
-
-
Save olivergeorge/1172987 to your computer and use it in GitHub Desktop.
URL pattern for Django Slugs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Example of URL Patterns based on slug fields. | |
""" | |
from django.conf.urls.defaults import patterns, url | |
urlpatterns = patterns('', | |
url(r'^(?P<slug>[-\w]+)$', 'myapp.views.some_view', name="some_view"), | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment