from forms import MyContactForm
from django.views.generic.edit import FormView
class MyFormView(FormView):
template_name = 'my_forms.html'
form_class = MyContactForm
success_url = '/thanks/'
私のテンプレートでは、フォームは次のように呼び出されます。
{{ form }}
しかし、どうすればこのように呼ぶことができますか?
{{ my_contact_form }}
?
object_context_name
これは、 (モデルの場合)と同等のフォームになります。