passing user instance django form submission

Solutions on MaxInterview for passing user instance django form submission by the best coders in the world

showing results for - "passing user instance django form submission"
Mya
14 Oct 2019
1if form.is_valid():
2    post = form.save(commit=False)
3    post.author = request.user
4    post.published_date = timezone.now()
5    post.save()
6