Advertisement
Md_Zahid_Hassan

view

Sep 23rd, 2019
737
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. def contact_info(request):
  2. if request.method == "POST":
  3. post = Contact()
  4. post.name = request.POST.get('name')
  5. post.email = request.POST.get('email')
  6. post.subject = request.POST.get('sub')
  7. post.message = request.POST.get('message')
  8. if post.message and post.name and post.email and post.subject:
  9. post.save()
  10. if post:
  11. return redirect('form')
  12.  
  13. return render(request, 'index.html')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement