[Django]-Django.core.exceptions.ImproperlyConfigured: CreateView is missing a QuerySet

4👍

Try changing the URL pattern to:

url(r'^note/create', views.CreateNoteView.as_view(), name='note_create')

Worked for me.

3👍

The problem is in the urls.py and I changed it to the name of my class name in views.py and this worked for me.

I changed the CreateView to my class name in my views.py.

Wrong url:

path('create-task/', views.CreateView.as_view(), name='create-task')

Right url:

path('create-task/', views.TaskCreate.as_view(), name='create-task')

TaskCreate is the name of my class in the views.py and I mistakenly put the CreateView instead of my class name of the views.py (‘TaskCreate’).

0👍

So I guess you use some kind of auto fill, and you want to pass the viwe class in your url.py but the intellisense put the CreateView in it for you. So in your view module you should import the django.views.generic and import a lot of view class, such as CreateView or ListView, and auto fill just help you fill it in mistankenly.

Leave a comment