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
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
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...