-5
from django.shortcuts import render

def index(request):
  context = {
    'title' : 'test'

  }
    return render(request,'index.html',context)

TabError: inconsistent use of tabs and spaces in indentation

halo
  • 9
  • 1
  • `context` should be a `dict`; please read about Python `dict` first. – heemayl Nov 09 '19 at 09:46
  • I just edited the question, please take a look again – halo Nov 09 '19 at 09:57
  • Does this answer your question? [Using Django view variables inside templates](https://stackoverflow.com/questions/3056263/using-django-view-variables-inside-templates) – funnydman Nov 10 '19 at 18:20

1 Answers1

0

Django's context data are just simple python dictionaries.

So you should define them like this:

context = {
    'first_key': first_value,
    'second_key': second_value,
}

Edit (as you change the question and error):

You should use tabs, or spaces, not both mixed together...

Pedram Parsian
  • 3,750
  • 3
  • 19
  • 34