Use first param in django URL
I开发者_如何学C want to to know if its possible to use the first "segment" of a Django URL as a parameter and what would that regex look like.
example:
(r'^blog/', include('blog.urls')),
url(r'^admin/', include(admin.site.urls)),
#### I want to use the following
(r'^THISISMYPARAM$, include("whatever")),
So then when someone visited http://example.com/SOMETHING I could use do something with that.
My regex keeps breaking my other urls :\
You can do something like this:
(r'^(?P<thisismyparam>\w+)$', include('whatever'))
精彩评论