Built-in view classes
- class feedback_form.views.FeedbackView
The base view class from which most custom contact-form views should inherit. If you don’t need any custom functionality, and it is inherited from the
FeedbackBaseView
class.You can also use it as-is (and the provided URLConf, feedback_form.urls, does exactly this).
- class feedback_form.views.FeedbackBaseView
The base view class from which most custom contact-form views should inherit. If you don’t need any custom functionality, and are content with the default
ContactFormBase
class.This is a subclass of Django’s
FormView
, so refer to the Django documentation for a list of attributes/methods which can be overridden to customize behavior.The following standard (from
FormView
) methods and attributes are commonly useful to override (all attributes below can also be passed toas_view()
in the URLconf, permitting customization without the need to write a full custom subclass of this class):- form_class
The form class to use. By default, will be
ContactForm
. This can also be overridden as a method namedform_class()
; this permits, for example, per-request customization (by inspecting attributes of self.request).
- feedback_form.views.success_message
A
str
, the text, which displayed to user, after successful form submission. By default, will be “Message is sent successfully”.
- feedback_form.views.success_url
A
str
, the name of urlpattern to redirect to after successful form submission.
- feedback_form.views.template_name
A
str
, the template to use when rendering the form. By default, will be feedback_form/feedback.html.