5👍
✅
You need add POST condition in your view, validate the form and then save it:
https://docs.djangoproject.com/en/dev/topics/forms/#using-a-form-in-a-view
0👍
If you are working with Django 1.5 try THIS
Maybe your view could be that:
class RecadoFormView(FormView):
model_class = RecadoForm
template_name = 'recados/index.html'
def valid_form(self, form):
form.instance.save() # Or form.save()
return super(RecadoFormView, self).valid_form(form)
- [Django]-Why does removing 'django.contrib.sites' from INSTALLED_APPS fix the 'DoesNotExist at /admin/' error that I suddenly got?
- [Django]-How to only sync custom permissions with syncdb?
Source:stackexchange.com