[Answer]-Post to API before saving to database in django class-based views

1👍

Sounds like overriding form_valid() would be a good way to go.

def form_valid(self, form):
    post_to_api(form.cleaned_data)
    # now call superclass to save the form
    return super(UpdateProfileView, self).form_valid(form)

Leave a comment