The "poll" app in the tutorial "getting started": Page not found (404)

How could I go wrong so soon. On the first tutorial !

Hey there, if you’re seeking for help you need to provide the details of your current project in order for others to be able to help you. In this type of case, generally we need to see:

  • the one inside your polls app/folder;
  • the one inside your polls app/folder;
  • the “root” one, located in the same directory of the and files.

In addition to the items above, you also need to specify what step you are on (which section of which page) and the URL that you are trying to access.

from django.http import HttpResponse

def index(request):
    return HttpResponse("Hello, world. You're at the polls index.")

← anything\polls\ →

from django.urls import path

from . import views

urlpatterns = [
    path("", views.index, name="index"),

← anything\mysite\ →

from django.contrib import admin
from django.urls import include, path

urlpatterns = [
    path("polls/", include("polls.urls")),

Page not found (404)

Request Method: GET
Request URL: http://localhost:8000/

Using the URLconf defined in mysite.urls, Django tried these URL patterns, in this order:

  1. polls/
  2. admin/

The empty path didn’t match any of these.

You’re seeing this error because you have DEBUG = True in your Django settings file. Change that to False, and Django will display a standard 404 page

This exact situation was discussed at Page not found (404) Include not working. In particular, see Page not found (404) Include not working - #7 by KenWhitesell

Side Note: When posting code or templates here, surround the code (or template) between lines of three backtick - ` characters. This means you’ll have a line of ```, then your code, then another line of ```. This forces the forum software to keep the text properly formatted.
(I’ve taken the liberty of fixing your original post for this.)

Writing your first Django app, part 1

(venv) PS C:\Users\joe\anything> python runserver

Never mind it works if I: