0

This is the output I got:

This is the output

I lerned how to do that here: https://docs.djangoproject.com/en/1.10/intro/tutorial03/

My code is:

def index(request):
   latest_question_list = Question.objects.order_by('-pub_date')[:5]
   template = loader.get_template('polls/index.html')
   context = {
    '   latest_question_list': latest_question_list,
   }
   # output = ', '.join([q.question_text for q in latest_question_list])
   return HttpResponse(template.render(context, request))

And this is the error raised:

 File "C:\Users\ab\mysite\polls\views.py", line 9
   context = {
          ^
IndentationError: unindent does not match any outer indentation level

What am I doing wrong?

Donald Duck
  • 8,409
  • 22
  • 75
  • 99
Kirtania
  • 21
  • 6

1 Answers1

0

Use the -tt option when you run Python. This will give you an error if you mix tabs and spaces.

KayEss
  • 2,290
  • 15
  • 31