problem with my first project

Hi folks. My primary interest is to setup the project for mailman3, but their docs don’t have much to say, so I need to learn django a bit.

I started the mysite project, but the runserver is not finding my polls urls, so here is the views.py from my mysite/polls directory

from django.http import HttpResponse

def index(request):
return HttpResponse(“Hello, world. You’re at the polls index.”)

Now here is the urls.py from the same directory

from django.urls import path

from . import views

urlpatterns = [
path(’’, views.index, name=‘index’),
]

Now here is the url.py from the main mysite directory

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

urlpatterns = [
path(‘polls/’, include(‘polls.urls’)),
path(‘admin/’, admin.site.urls),

]

So, I am getting a 404 and it is only searching admin, I am sure I am doing something wrong, but I am not sure what.

Thanks in advance for any suggestions.

What url are you entering that is giving you the 404? (Have you tried “/polls/”?)

I am using http://localhost:8000/polls if I just use 8000 I get the
congratulations page.

Notice the trailing ‘/’. Give that a try.

I tried http://localhost:8000/polls and http://localhost:8000/polls/ but no difference.

You problem is: path(’’, views.index, name=‘index’),
you are using u02BC - ‘modifier letter apostrophe’
but you should use u0027 - ‘apostrophe’.

Btw. when I am here I have also one question regarding my first project. I have just completed this cool Django introduction and I found small problem in part 6 - https://docs.djangoproject.com/en/3.1/intro/tutorial06

Here is part when I add body background to polls/static/polls/style.css cascade sheet but there is this
small problem - template previously created does not have body tags, so of course its not displaying it. I am not sure where this can be reported, so maybe someone know ?

Or its maybe this forum - doing characters modification :slight_smile: