There is no function index in views. That is the problem. Create a function named index in views.
On Wed, 18 Mar 2020, 22:30 Laurent Gattegno, <laurentgatte...@gmail.com> wrote: > I think the problem is inside the views.py file. It looks like python > doesnt find views.index and the problem may be the index > Laurent Gattegno > > > Le mer. 18 mars 2020 à 12:58, דביר חומרי <dvir...@gmail.com> a > écrit : > >> >> >> בתאריך יום שלישי, 17 במרץ 2020 בשעה 20:03:10 UTC+2, מאת דביר חומרי: >>> >>> i was following the toturial and i could'nt find why this error is >>> accure. >>> polls/urls.py' >>> >>> from django.urls import path >>> >>> from . import views >>> >>> urlpatterns = [ >>> path('', views.index, name='index'), >>> ] >>> >>> >>> and got this error: >>> >>> Traceback (most recent call last): >>> File "c:\Users\......polls\urls.py", line 20, in <module> >>> from . import views >>> ImportError: cannot import name 'views' >>> >>> >> >>> p.s. views.py is in the same directory as urls.py >>> >> >> >> the directory: >> >> __init__.py >> admin.py >> apps.py >> migrations/ >> __init__.py >> models.py >> tests.py >> urls.py >> >> views.py >> >>> >>> ¶ <https://docs.djangoproject.com/en/3.0/intro/tutorial01/#id2>\ >>> >>> -- >> You received this message because you are subscribed to the Google Groups >> "Django users" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to django-users+unsubscr...@googlegroups.com. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/django-users/efad75fa-39e1-4579-8859-a0c6f74a5791%40googlegroups.com >> <https://groups.google.com/d/msgid/django-users/efad75fa-39e1-4579-8859-a0c6f74a5791%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to django-users+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/django-users/CAHa%2B34%3DqPercBxCySksPGUkMO%3DZD-4BEs0DjQc2xFf41gUMyOA%40mail.gmail.com > <https://groups.google.com/d/msgid/django-users/CAHa%2B34%3DqPercBxCySksPGUkMO%3DZD-4BEs0DjQc2xFf41gUMyOA%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CADBepW9FgaeAi84zNaKUTFuSSxyWsk4XYkDqFYja4vP2A1a9vQ%40mail.gmail.com.