1👍
✅
CreateView
inherits from ModelFormMixin
. Override the form_valid
method to change the behaviour when the form is valid.
You can see the code for the form_valid
method on GitHub. The default behaviour is described in the docs as:
form_valid(form)
Saves the form instance, sets the current object for the view, and redirects toget_success_url()
.
Source:stackexchange.com