From 8bea592155225914b686cd510adf7f53b845e729 Mon Sep 17 00:00:00 2001 From: Basyrov Rustam Date: Tue, 3 Jun 2025 22:19:57 +0300 Subject: [PATCH] some changes --- mysite/urls.py | 3 ++- polls/urls.py | 7 +++++++ polls/views.py | 4 +++- 3 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 polls/urls.py diff --git a/mysite/urls.py b/mysite/urls.py index 78a55d5..8163b49 100644 --- a/mysite/urls.py +++ b/mysite/urls.py @@ -15,8 +15,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 include, path urlpatterns = [ + path("polls/", include("polls.urls")), path("admin/", admin.site.urls), ] diff --git a/polls/urls.py b/polls/urls.py new file mode 100644 index 0000000..5119061 --- /dev/null +++ b/polls/urls.py @@ -0,0 +1,7 @@ +from django.urls import path + +from . import views + +urlpatterns = [ + path("", views.index, name="index"), +] diff --git a/polls/views.py b/polls/views.py index 91ea44a..bbe73cf 100644 --- a/polls/views.py +++ b/polls/views.py @@ -1,3 +1,5 @@ from django.shortcuts import render +from django.http import HttpResponse -# Create your views here. +def index(request): + return HttpResponse("Hello, world. You're at the polls index.")