Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Base url.py
- from django.conf.urls import include, url
- from django.contrib import admin
- urlpatterns = [
- # Examples:
- # url(r'^$', 'demo.views.home', name='home'),
- # url(r'^blog/', include('blog.urls')),
- url(r'^admin/', include(admin.site.urls)),
- url(r'^polls/',include('polls.urls',namespace="polls")),
- ]
- polls/urls.py
- from django.conf.urls import url
- from . import views
- urlpatterns = [
- url(r'^$', views.index,name='index'),
- url(r'^(?P<question_id>[0-9]+)/$', views.detail,name='detail'),
- url(r'^(?P<question_id>[0-9]+)/results/$', views.results,name='result'),
- url(r'^(?P<question_id>[0-9]+)/vote/$', views.vote,name='vote'),
- ]
Advertisement
Add Comment
Please, Sign In to add comment