M
M
Mike2016-09-15 19:05:02
Django
Mike, 2016-09-15 19:05:02

How to get some.html file from views.py in Django?

def wrongwerbs(request):
  global ru, en, shit, errors, right, userWord
  if request.method == "POST":
      userWord = request.POST['word'].lower().strip()
      ru.pop(0)
      if userWord == en.pop(0):
      	right += 1
      	print("It's right")
      else:
      	errors += 1
      	print("It's not correct")
      if errors + right == 5:
            # Здесь мне нужно получить файл "the_end.html", но не получается
      	return redirect('/werbs/templates/werbs/the_end.html')

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
sim3x, 2016-09-15
@sim3x

Write the number of errors in the session
Check
in the view If the threshold is exceeded, then render another template and show the number there

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question