Reputation: 13
I'm getting this error when I go to http://127.0.0.1:8000/
I've gone through other similar threads and have tried playing around with spaces as well as single and double quotation marks but with no luck. I'm trying to have the index.html file inherit the code in master.html, which is contained in a folder structure that looks like this.
Here are a few snippets of some of the files that I think are causing this error:
from settings.py:
BASE_DIR = Path(__file__).resolve().parent.parent
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'tracker',
]
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [os.path.join(BASE_DIR,'templates')],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]
from index.html (this is the only line in this file)
{% extends ‘layouts/master.html’ %}
from views.py
# Create your views here.
from django.shortcuts import render
def index(request):
return render(request, 'index.html')
Error traceback:
Exception Type: TemplateSyntaxError at /
Exception Value: Could not parse the remainder: '‘layouts/master.html’' from '‘layouts/master.html’'
What seems to be causing the syntax error?
Thanks in advance
Upvotes: 1
Views: 275
Reputation: 615
Instead of {% extends ‘layouts/master.html’ %}
use {% extends 'layouts/master.html' %}
Upvotes: 3