2👍
✅
You should use saving groups in your urls.py
:
from django.conf.urls import patterns, url
urlpatterns = patterns('',
url(r'^(?P<part>\w*)/$', 'my_app.views.my_view'),
)
Then, in your my_view
view the string will appear as a keyword argument:
def my_view(request, part=None):
print part
Hope that helps.
Source:stackexchange.com