Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

django create view class

###### 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 by # #
 
PREVIOUS NEXT
Tagged: #django #create #view #class
ADD COMMENT
Topic
Name
2+6 =