Django: How can I organize common form submisson part into a function?

Published: 14/01/2019
Django: How can I organize common form submisson part into a function?
Source: STACKOVERFLOW.COM

I'm creating a website. For my website, user can edit their profile on every page because there's a navbar and from edit profile section, form on modal appears. So I'd like to organize this part into a function. But it seems difficult. def index(request): if request.method != 'POST': profile_form = ProfileForm(instance=request.user) elif 'profile_form' in request.POST: profile_form = Profil

Read more
Related news
Comment
FACEBOOK