Skip to content

Instantly share code, notes, and snippets.

@saturngod
Created May 15, 2011 15:53
Show Gist options
  • Save saturngod/973258 to your computer and use it in GitHub Desktop.
Save saturngod/973258 to your computer and use it in GitHub Desktop.
url patterns in django
urlpatterns = patterns('',
(r'^$',main_page),
(r'^user/(\w+)/$',user_page),
(r'^login/$','django.contrib.auth.views.login'),
(r'^logout/$',logout_page),
(r'^site_media/(?P<path>.*)$', 'django.views.static.serve',
{ 'document_root': site_media }),
(r'^register/$',register_page),
(r'^register/success/$',direct_to_template,{'template':'registration/register_success.html'}),
# Examples:
# url(r'^$', 'django_bookmarks.views.home', name='home'),
# url(r'^django_bookmarks/', include('django_bookmarks.foo.urls')),
# Uncomment the admin/doc line below to enable admin documentation:
# url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
# Uncomment the next line to enable the admin:
# url(r'^admin/', include(admin.site.urls)),
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment