Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

Django Create View

class AuthorCreateView(CreateView):
    form_class = AuthorForm
    template_name = 'author_new.html'
    success_url = 'success'
Comment

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()),]
Comment

PREVIOUS NEXT
Code Example
Python :: argparse accept only few options 
Python :: dict map() 
Python :: Python script for computing descriptive statistics 
Python :: python sort by length and alphabetically 
Python :: function in the input function python 
Python :: pandas transform 
Python :: post list python 
Python :: how to make a key logger 
Python :: python command line keyword arguments 
Python :: python unittest coverage main function 
Python :: merge keep left index 
Python :: python if elif 
Python :: python web framework 
Python :: shuffle text lines python 
Python :: del list python 
Python :: pandas create average per group 
Python :: django model query join 
Python :: python treemap example 
Python :: python str of list 
Python :: dockerfile to run python script 
Python :: flask rest api upload image 
Python :: matrix rotation in python 
Python :: how to add value in array django 
Python :: python try catch print stack 
Python :: arange float step 
Python :: numpy randomly swap lines 
Python :: Combine integer in list 
Python :: learn basic facts about dataframe | dataframe info 
Python :: python time 
Python :: type conversion python 
ADD CONTENT
Topic
Content
Source link
Name
4+8 =