Changeset - 9fecb37c61f1
[Not reviewed]
0 1 0
Ben Sturmfels (bsturmfels) - 1 month ago 2024-03-06 08:02:00
ben@sturm.com.au
Update the path to templates in index()
1 file changed with 4 insertions and 1 deletions:
0 comments (0 inline, 0 general)
conservancy/views.py
Show inline comments
...
 
@@ -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.
0 comments (0 inline, 0 general)