-
-
Save dennohpeter/8cbd8ab81ecd446bde0e38d65ec0bf7b to your computer and use it in GitHub Desktop.
Blog create
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# @login_required | |
@staff_member_required | |
def blog_post_create_view(request): | |
form = BlogModelForm(request.POST or None, request.FILES or None) | |
if form.is_valid(): | |
print(form.cleaned_data) | |
form = form.save(commit=False) | |
form.user = request.user | |
form.save() | |
template_name = "form.html" | |
context = {'form':form} | |
return render(request,template_name,context) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment