Finished part 1: created a single view

master
Jason Zhu 2020-10-18 20:44:01 +11:00
parent 67bf818034
commit ea90d9989e
3 changed files with 13 additions and 2 deletions

View File

@ -14,8 +14,9 @@ Including another URLconf
2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) 2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
""" """
from django.contrib import admin from django.contrib import admin
from django.urls import path from django.urls import path, include
urlpatterns = [ urlpatterns = [
path('admin/', admin.site.urls), path('admin/', admin.site.urls),
path('polls/', include('polls.urls')),
] ]

View File

@ -0,0 +1,7 @@
from django.urls import path
from . import views
urlpatterns = [
path('', views.index, name='index'),
]

View File

@ -1,2 +1,5 @@
from django.http import request from django.http import request, HttpResponse
from django.shortcuts import render from django.shortcuts import render
def index(request):
return HttpResponse("Hello, world. You're at the polls index")