urls.py 1.5 KB

123456789101112131415161718192021
  1. from django.conf.urls import patterns, include, url
  2. urlpatterns = patterns('',
  3. url(r'^$','socialnetwork.views.home',name='home'),
  4. # Route for built-in authentication with our own custom login page
  5. url(r'^login$', 'django.contrib.auth.views.login', {'template_name':'socialnetwork/login.html'}, name='login'),
  6. # Route to logout a user and send them back to the login page
  7. url(r'^logout$','django.contrib.auth.views.logout_then_login',name='logout'),
  8. url(r'^register$', 'socialnetwork.views.register', name='register'),
  9. url(r'^add-post$', 'socialnetwork.views.add_post', name='add_post'),
  10. url(r'^edit-profile$', 'socialnetwork.views.editprofile', name='edit_profile'),
  11. url(r'^profile/(?P<user_id>\d+)$', 'socialnetwork.views.profile', name='profile'),
  12. url(r'^photo/(?P<id>\d+)$', 'socialnetwork.views.get_photo', name='photo'),
  13. url(r'^followerstream$', 'socialnetwork.views.followerstream', name='followerstream'),
  14. url(r'^follow/(?P<user_id>\d+$)', 'socialnetwork.views.follow', name='follow'),
  15. url(r'^unfollow/(?P<user_id>\d+$)', 'socialnetwork.views.unfollow', name='unfollow'),
  16. url(r'^get-list-json$', 'socialnetwork.views.get_list_json'),
  17. url(r'^refresh_page$', 'socialnetwork.views.refresh_page'),
  18. url(r'^add-comment$', 'socialnetwork.views.add_comment', name='add_comment'),
  19. url(r'^confirm-registration/(?P<username>[a-zA-Z0-9_@\+\-]+)/(?P<token>[a-z0-9\-]+)$', 'socialnetwork.views.confirm_registration', name='confirm'),
  20. )