diff --git a/mysite/mysite/urls.py b/mysite/mysite/urls.py index e7f9f35..2164217 100644 --- a/mysite/mysite/urls.py +++ b/mysite/mysite/urls.py @@ -14,8 +14,9 @@ Including another URLconf 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) """ from django.contrib import admin -from django.urls import path +from django.urls import path, include urlpatterns = [ path('admin/', admin.site.urls), + path('polls/', include('polls.urls')), ] diff --git a/mysite/polls/urls.py b/mysite/polls/urls.py new file mode 100644 index 0000000..3ef24d9 --- /dev/null +++ b/mysite/polls/urls.py @@ -0,0 +1,7 @@ +from django.urls import path + +from . import views + +urlpatterns = [ + path('', views.index, name='index'), +] \ No newline at end of file diff --git a/mysite/polls/views.py b/mysite/polls/views.py index c53ddeb..ad2c866 100644 --- a/mysite/polls/views.py +++ b/mysite/polls/views.py @@ -1,2 +1,5 @@ -from django.http import request +from django.http import request, HttpResponse from django.shortcuts import render + +def index(request): + return HttpResponse("Hello, world. You're at the polls index") \ No newline at end of file