Guest User

djangodemo

a guest
Apr 15th, 2015
273
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. Base url.py
  2.  
  3. from django.conf.urls import include, url
  4. from django.contrib import admin
  5.  
  6. urlpatterns = [
  7. # Examples:
  8. # url(r'^$', 'demo.views.home', name='home'),
  9. # url(r'^blog/', include('blog.urls')),
  10.  
  11. url(r'^admin/', include(admin.site.urls)),
  12. url(r'^polls/',include('polls.urls',namespace="polls")),
  13. ]
  14.  
  15.  
  16. polls/urls.py
  17.  
  18. from django.conf.urls import url
  19. from . import views
  20.  
  21. urlpatterns = [
  22.  
  23. url(r'^$', views.index,name='index'),
  24. url(r'^(?P<question_id>[0-9]+)/$', views.detail,name='detail'),
  25. url(r'^(?P<question_id>[0-9]+)/results/$', views.results,name='result'),
  26. url(r'^(?P<question_id>[0-9]+)/vote/$', views.vote,name='vote'),
  27. ]
Advertisement
Add Comment
Please, Sign In to add comment