0

So I was following a tutorial on Youtube, and here is the link: https://www.youtube.com/watch?v=Rpi0Ne1nMdk and I got to 12:46 when he got to importing Index. I hit run, but I received a Syntax Error instead. Here is a sample of my code:

from django.urls import path
from landing.views import Index


urlpatterns = [
  path('', Index.as_view(), name='index'), 
]

when I hit run, this returned:

ImportError: cannot import name 'Index' from 'landing.views' (/home/runner/red-chilli-media/landing/views.py)

If it looks weird, it's because I'm using replit. I used the django project, and the language is Python/HTML. if any information is missing, please tell me. The error is in Python, as you can clearly see.

0 Answers0