Answer the question
In order to leave comments, you need to log in
Django, how to write an edit view?
You need to get user data from the database with a GET request.
@login_required()
def edit_my_draft(request, username):
title = 'Редактирование записи в черновике'
user = get_object_or_404(User, username=username)
if request.method != 'POST':
form = DraftForm(instance=user)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question