Skip to content

Instantly share code, notes, and snippets.

@ashchristopher
Created June 13, 2013 18:26
Show Gist options
  • Save ashchristopher/5776108 to your computer and use it in GitHub Desktop.
Save ashchristopher/5776108 to your computer and use it in GitHub Desktop.
List all django urls
import urls
def show_urls(urllist, depth=0):
for entry in urllist:
print " " * depth, entry.regex.pattern
if hasattr(entry, 'url_patterns'):
show_urls(entry.url_patterns, depth + 1)
show_urls(urls.urlpatterns)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment