Update the path to templates in index()
This commit is contained in:
parent
dd27742114
commit
9fecb37c61
1 changed files with 4 additions and 1 deletions
|
@ -6,6 +6,9 @@ from django.template.response import TemplateResponse
|
|||
|
||||
from .local_context_processors import fundgoal_lookup
|
||||
|
||||
# This component doesn't actually have anything to do with Django's
|
||||
# "staticfiles" app. It's only that its templates happen to be located in the
|
||||
# STATIC_ROOT directory. They probably shouldn't be there.
|
||||
STATIC_ROOT = os.path.abspath(os.path.dirname(__file__))
|
||||
FILESYSTEM_ENCODING = 'utf-8'
|
||||
|
||||
|
@ -33,7 +36,7 @@ def index(request, *args, **kwargs):
|
|||
path = request.path.lstrip('/')
|
||||
if path.endswith('/'):
|
||||
path += 'index.html'
|
||||
fullpath = os.path.join(STATIC_ROOT, path)
|
||||
fullpath = os.path.join(STATIC_ROOT, 'static', path)
|
||||
try:
|
||||
# Junk URLs in production (Python 3.5) are causing UnicodeEncodeErrors
|
||||
# here. Can't reproduce in development in Python 3.9 - only Python 2.7.
|
||||
|
|
Loading…
Reference in a new issue