[Django]-Django: How to add other urls patterns from the same file in urls.py..?

3👍

try this \w+ instead of \S+ and not '' but the path to user views:

profile_patterns = patterns('userapp.views',
  url(r'^profile/$', profile),
  url(r'^thoughts/$', thoughts),
) 

urlpatterns = patterns('',      
  url(r'^/user/(?P<username>\w+)/', include(profile_patterns)),
)

Leave a comment