Eroor django-urls

时间:2019-03-22 20:09:18

标签: django python-3.x django-urls

PyObject_GenericSetattr

我的IDE在from django.urls import path, re_path from . import views app_name="home-app" urlpatterns = [ path('nueva-url', IndexView.views(), name='index')#this synthesis does not work, it gives me an error. ] 下画一条红线,如下所示: enter image description here

1 个答案:

答案 0 :(得分:2)

更改您的进口声明:

from .views import IndexView

urlpatterns = [ 
    path('nueva-url', IndexView.as_view(), name='index')
]