Advertisement
MartinYanchev-99

views.py

Oct 11th, 2020 (edited)
2,228
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.36 KB | None | 0 0
  1. def exercise(request,id):
  2.     exercise = Exercise.objects.get(id=id)
  3.     if request.method == 'POST':
  4.         form = SolveExercise(request.POST)
  5.         answer = form.clean()
  6.         print(answer)
  7.     form = SolveExercise()
  8.  
  9.     context = {
  10.         "exercise":exercise,
  11.         "form":form
  12.     }
  13.     return render(request,"core/exercise.html",context)
  14.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement