Question : django create view class
Answered by : shahin-najafi
###### views.py #####
from .forms import CreateArticleForm
from django.views.generic import CreateView
class ArticleCreateView(CreateView): form_class = CreateArticleForm template_name = 'articles/create_article.html'
###### urls.py ######
from .views import ArticleCreateView
urlpatterns =[ path('articles/create/', ArticleCreateView.as_view()),]
Source : https://www.youtube.com/watch?v=KB_wDXBwhUA | Last Update : Fri, 24 Apr 20
Question : Django Create View
Answered by : ifeanyi-omeata
class AuthorCreateView(CreateView): form_class = AuthorForm template_name = 'author_new.html' success_url = 'success'
Source : https://stackoverflow.com/questions/5773724/how-do-i-use-createview-with-a-modelform | Last Update : Thu, 12 May 22