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.
]
更改您的import语句:
from .views import IndexView
urlpatterns = [
path('nueva-url', IndexView.as_view(), name='index')
]