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’).
- [Django]-Django application deployed at suburl, redirect to home page after login
- [Django]-Local Django website won't load in browser
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.
- [Django]-How to Change order of Modules listed in Side Bar of Django Admin
- [Django]-ManyToMany in Django admin: select none
- [Django]-I want to redirect to link on <a> only after confimation?
Source:stackexchange.com