diff --git a/conservancy/views.py b/conservancy/views.py index 2913f2b1..bcdd2a78 100644 --- a/conservancy/views.py +++ b/conservancy/views.py @@ -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.