diff --git a/conservancy/static/GiveUpGitHub/index.html b/conservancy/content/GiveUpGitHub/index.html similarity index 100% rename from conservancy/static/GiveUpGitHub/index.html rename to conservancy/content/GiveUpGitHub/index.html diff --git a/conservancy/static/about/board/index.html b/conservancy/content/about/board/index.html similarity index 100% rename from conservancy/static/about/board/index.html rename to conservancy/content/about/board/index.html diff --git a/conservancy/static/about/contact/accounts-taxinfo.asc b/conservancy/content/about/contact/accounts-taxinfo.asc similarity index 100% rename from conservancy/static/about/contact/accounts-taxinfo.asc rename to conservancy/content/about/contact/accounts-taxinfo.asc diff --git a/conservancy/static/about/contact/index.html b/conservancy/content/about/contact/index.html similarity index 100% rename from conservancy/static/about/contact/index.html rename to conservancy/content/about/contact/index.html diff --git a/conservancy/static/about/eval-committee/index.html b/conservancy/content/about/eval-committee/index.html similarity index 100% rename from conservancy/static/about/eval-committee/index.html rename to conservancy/content/about/eval-committee/index.html diff --git a/conservancy/static/about/index.html b/conservancy/content/about/index.html similarity index 100% rename from conservancy/static/about/index.html rename to conservancy/content/about/index.html diff --git a/conservancy/static/about/license/index.html b/conservancy/content/about/license/index.html similarity index 100% rename from conservancy/static/about/license/index.html rename to conservancy/content/about/license/index.html diff --git a/conservancy/static/about/outside/index.html b/conservancy/content/about/outside/index.html similarity index 100% rename from conservancy/static/about/outside/index.html rename to conservancy/content/about/outside/index.html diff --git a/conservancy/static/about/staff/index.html b/conservancy/content/about/staff/index.html similarity index 100% rename from conservancy/static/about/staff/index.html rename to conservancy/content/about/staff/index.html diff --git a/conservancy/static/about/transparency/index.html b/conservancy/content/about/transparency/index.html similarity index 100% rename from conservancy/static/about/transparency/index.html rename to conservancy/content/about/transparency/index.html diff --git a/conservancy/static/activities/index.html b/conservancy/content/activities/index.html similarity index 100% rename from conservancy/static/activities/index.html rename to conservancy/content/activities/index.html diff --git a/conservancy/static/copyleft-compliance/about.html b/conservancy/content/copyleft-compliance/about.html similarity index 100% rename from conservancy/static/copyleft-compliance/about.html rename to conservancy/content/copyleft-compliance/about.html diff --git a/conservancy/static/copyleft-compliance/enforcement-strategy.html b/conservancy/content/copyleft-compliance/enforcement-strategy.html similarity index 100% rename from conservancy/static/copyleft-compliance/enforcement-strategy.html rename to conservancy/content/copyleft-compliance/enforcement-strategy.html diff --git a/conservancy/static/copyleft-compliance/firmware-liberation.html b/conservancy/content/copyleft-compliance/firmware-liberation.html similarity index 100% rename from conservancy/static/copyleft-compliance/firmware-liberation.html rename to conservancy/content/copyleft-compliance/firmware-liberation.html diff --git a/conservancy/static/copyleft-compliance/glossary.html b/conservancy/content/copyleft-compliance/glossary.html similarity index 100% rename from conservancy/static/copyleft-compliance/glossary.html rename to conservancy/content/copyleft-compliance/glossary.html diff --git a/conservancy/static/copyleft-compliance/help.html b/conservancy/content/copyleft-compliance/help.html similarity index 100% rename from conservancy/static/copyleft-compliance/help.html rename to conservancy/content/copyleft-compliance/help.html diff --git a/conservancy/static/copyleft-compliance/index.html b/conservancy/content/copyleft-compliance/index.html similarity index 100% rename from conservancy/static/copyleft-compliance/index.html rename to conservancy/content/copyleft-compliance/index.html diff --git a/conservancy/static/copyleft-compliance/linux-vs-vmkernel_de.png b/conservancy/content/copyleft-compliance/linux-vs-vmkernel_de.png similarity index 100% rename from conservancy/static/copyleft-compliance/linux-vs-vmkernel_de.png rename to conservancy/content/copyleft-compliance/linux-vs-vmkernel_de.png diff --git a/conservancy/static/copyleft-compliance/linux-vs-vmkernel_de.svg b/conservancy/content/copyleft-compliance/linux-vs-vmkernel_de.svg similarity index 100% rename from conservancy/static/copyleft-compliance/linux-vs-vmkernel_de.svg rename to conservancy/content/copyleft-compliance/linux-vs-vmkernel_de.svg diff --git a/conservancy/static/copyleft-compliance/linux-vs-vmkernel_en.png b/conservancy/content/copyleft-compliance/linux-vs-vmkernel_en.png similarity index 100% rename from conservancy/static/copyleft-compliance/linux-vs-vmkernel_en.png rename to conservancy/content/copyleft-compliance/linux-vs-vmkernel_en.png diff --git a/conservancy/static/copyleft-compliance/linux-vs-vmkernel_en.svg b/conservancy/content/copyleft-compliance/linux-vs-vmkernel_en.svg similarity index 100% rename from conservancy/static/copyleft-compliance/linux-vs-vmkernel_en.svg rename to conservancy/content/copyleft-compliance/linux-vs-vmkernel_en.svg diff --git a/conservancy/static/copyleft-compliance/linux-vs-vmkernel_en_scaled.png b/conservancy/content/copyleft-compliance/linux-vs-vmkernel_en_scaled.png similarity index 100% rename from conservancy/static/copyleft-compliance/linux-vs-vmkernel_en_scaled.png rename to conservancy/content/copyleft-compliance/linux-vs-vmkernel_en_scaled.png diff --git a/conservancy/static/copyleft-compliance/past-lawsuits.html b/conservancy/content/copyleft-compliance/past-lawsuits.html similarity index 100% rename from conservancy/static/copyleft-compliance/past-lawsuits.html rename to conservancy/content/copyleft-compliance/past-lawsuits.html diff --git a/conservancy/static/copyleft-compliance/principles.cn.html b/conservancy/content/copyleft-compliance/principles.cn.html similarity index 100% rename from conservancy/static/copyleft-compliance/principles.cn.html rename to conservancy/content/copyleft-compliance/principles.cn.html diff --git a/conservancy/static/copyleft-compliance/principles.cn.pdf b/conservancy/content/copyleft-compliance/principles.cn.pdf similarity index 100% rename from conservancy/static/copyleft-compliance/principles.cn.pdf rename to conservancy/content/copyleft-compliance/principles.cn.pdf diff --git a/conservancy/static/copyleft-compliance/principles.html b/conservancy/content/copyleft-compliance/principles.html similarity index 100% rename from conservancy/static/copyleft-compliance/principles.html rename to conservancy/content/copyleft-compliance/principles.html diff --git a/conservancy/static/copyleft-compliance/principles.kr.html b/conservancy/content/copyleft-compliance/principles.kr.html similarity index 100% rename from conservancy/static/copyleft-compliance/principles.kr.html rename to conservancy/content/copyleft-compliance/principles.kr.html diff --git a/conservancy/static/copyleft-compliance/principles.kr.pdf b/conservancy/content/copyleft-compliance/principles.kr.pdf similarity index 100% rename from conservancy/static/copyleft-compliance/principles.kr.pdf rename to conservancy/content/copyleft-compliance/principles.kr.pdf diff --git a/conservancy/static/copyleft-compliance/vizio-filing-press-release.html b/conservancy/content/copyleft-compliance/vizio-filing-press-release.html similarity index 100% rename from conservancy/static/copyleft-compliance/vizio-filing-press-release.html rename to conservancy/content/copyleft-compliance/vizio-filing-press-release.html diff --git a/conservancy/static/copyleft-compliance/vizio.html b/conservancy/content/copyleft-compliance/vizio.html similarity index 100% rename from conservancy/static/copyleft-compliance/vizio.html rename to conservancy/content/copyleft-compliance/vizio.html diff --git a/conservancy/static/copyleft-compliance/vmware-code-similarity.html b/conservancy/content/copyleft-compliance/vmware-code-similarity.html similarity index 100% rename from conservancy/static/copyleft-compliance/vmware-code-similarity.html rename to conservancy/content/copyleft-compliance/vmware-code-similarity.html diff --git a/conservancy/static/copyleft-compliance/vmware-lawsuit-appeal.html b/conservancy/content/copyleft-compliance/vmware-lawsuit-appeal.html similarity index 100% rename from conservancy/static/copyleft-compliance/vmware-lawsuit-appeal.html rename to conservancy/content/copyleft-compliance/vmware-lawsuit-appeal.html diff --git a/conservancy/static/copyleft-compliance/vmware-lawsuit-faq.html b/conservancy/content/copyleft-compliance/vmware-lawsuit-faq.html similarity index 100% rename from conservancy/static/copyleft-compliance/vmware-lawsuit-faq.html rename to conservancy/content/copyleft-compliance/vmware-lawsuit-faq.html diff --git a/conservancy/static/donate/index.html b/conservancy/content/donate/index.html similarity index 100% rename from conservancy/static/donate/index.html rename to conservancy/content/donate/index.html diff --git a/conservancy/static/fossy/index.html b/conservancy/content/fossy/index.html similarity index 100% rename from conservancy/static/fossy/index.html rename to conservancy/content/fossy/index.html diff --git a/conservancy/static/learn/index.html b/conservancy/content/learn/index.html similarity index 100% rename from conservancy/static/learn/index.html rename to conservancy/content/learn/index.html diff --git a/conservancy/static/npoacct/index.html b/conservancy/content/npoacct/index.html similarity index 100% rename from conservancy/static/npoacct/index.html rename to conservancy/content/npoacct/index.html diff --git a/conservancy/static/press/index.html b/conservancy/content/press/index.html similarity index 100% rename from conservancy/static/press/index.html rename to conservancy/content/press/index.html diff --git a/conservancy/static/press/inthenews.html b/conservancy/content/press/inthenews.html similarity index 100% rename from conservancy/static/press/inthenews.html rename to conservancy/content/press/inthenews.html diff --git a/conservancy/static/press/kit.html b/conservancy/content/press/kit.html similarity index 100% rename from conservancy/static/press/kit.html rename to conservancy/content/press/kit.html diff --git a/conservancy/static/press/qanda.html b/conservancy/content/press/qanda.html similarity index 100% rename from conservancy/static/press/qanda.html rename to conservancy/content/press/qanda.html diff --git a/conservancy/static/press/vizio-coverage.html b/conservancy/content/press/vizio-coverage.html similarity index 100% rename from conservancy/static/press/vizio-coverage.html rename to conservancy/content/press/vizio-coverage.html diff --git a/conservancy/static/privacy-policy/index.html b/conservancy/content/privacy-policy/index.html similarity index 100% rename from conservancy/static/privacy-policy/index.html rename to conservancy/content/privacy-policy/index.html diff --git a/conservancy/static/projects/apply/ConservancyFSATemplate.pdf b/conservancy/content/projects/apply/ConservancyFSATemplate.pdf similarity index 100% rename from conservancy/static/projects/apply/ConservancyFSATemplate.pdf rename to conservancy/content/projects/apply/ConservancyFSATemplate.pdf diff --git a/conservancy/static/projects/apply/conservancy-fsa-template.odt b/conservancy/content/projects/apply/conservancy-fsa-template.odt similarity index 100% rename from conservancy/static/projects/apply/conservancy-fsa-template.odt rename to conservancy/content/projects/apply/conservancy-fsa-template.odt diff --git a/conservancy/static/projects/apply/conservancy-fsa-template.tex b/conservancy/content/projects/apply/conservancy-fsa-template.tex similarity index 100% rename from conservancy/static/projects/apply/conservancy-fsa-template.tex rename to conservancy/content/projects/apply/conservancy-fsa-template.tex diff --git a/conservancy/static/projects/apply/index.html b/conservancy/content/projects/apply/index.html similarity index 100% rename from conservancy/static/projects/apply/index.html rename to conservancy/content/projects/apply/index.html diff --git a/conservancy/static/projects/current/index.html b/conservancy/content/projects/current/index.html similarity index 100% rename from conservancy/static/projects/current/index.html rename to conservancy/content/projects/current/index.html diff --git a/conservancy/static/projects/index.html b/conservancy/content/projects/index.html similarity index 100% rename from conservancy/static/projects/index.html rename to conservancy/content/projects/index.html diff --git a/conservancy/static/projects/policies/conflict-of-interest-policy.9ed5723d4fa0cd23ff52a8945bd8b82d0b80b590.html b/conservancy/content/projects/policies/conflict-of-interest-policy.9ed5723d4fa0cd23ff52a8945bd8b82d0b80b590.html similarity index 100% rename from conservancy/static/projects/policies/conflict-of-interest-policy.9ed5723d4fa0cd23ff52a8945bd8b82d0b80b590.html rename to conservancy/content/projects/policies/conflict-of-interest-policy.9ed5723d4fa0cd23ff52a8945bd8b82d0b80b590.html diff --git a/conservancy/static/projects/policies/conflict-of-interest-policy.d477e1b02e2093594db118aaa956da8c93129d58.html b/conservancy/content/projects/policies/conflict-of-interest-policy.d477e1b02e2093594db118aaa956da8c93129d58.html similarity index 100% rename from conservancy/static/projects/policies/conflict-of-interest-policy.d477e1b02e2093594db118aaa956da8c93129d58.html rename to conservancy/content/projects/policies/conflict-of-interest-policy.d477e1b02e2093594db118aaa956da8c93129d58.html diff --git a/conservancy/static/projects/policies/conflict-of-interest-policy.html b/conservancy/content/projects/policies/conflict-of-interest-policy.html similarity index 100% rename from conservancy/static/projects/policies/conflict-of-interest-policy.html rename to conservancy/content/projects/policies/conflict-of-interest-policy.html diff --git a/conservancy/static/projects/policies/conservancy-travel-policy.11ae065865d3a0b78bb5f2d894c5f955e49e4f0f.html b/conservancy/content/projects/policies/conservancy-travel-policy.11ae065865d3a0b78bb5f2d894c5f955e49e4f0f.html similarity index 100% rename from conservancy/static/projects/policies/conservancy-travel-policy.11ae065865d3a0b78bb5f2d894c5f955e49e4f0f.html rename to conservancy/content/projects/policies/conservancy-travel-policy.11ae065865d3a0b78bb5f2d894c5f955e49e4f0f.html diff --git a/conservancy/static/projects/policies/conservancy-travel-policy.3b1bc93469c1bb9ceb479f32c29fd7a8ee3521e3.html b/conservancy/content/projects/policies/conservancy-travel-policy.3b1bc93469c1bb9ceb479f32c29fd7a8ee3521e3.html similarity index 100% rename from conservancy/static/projects/policies/conservancy-travel-policy.3b1bc93469c1bb9ceb479f32c29fd7a8ee3521e3.html rename to conservancy/content/projects/policies/conservancy-travel-policy.3b1bc93469c1bb9ceb479f32c29fd7a8ee3521e3.html diff --git a/conservancy/static/projects/policies/conservancy-travel-policy.44cea2c1e51c72e115dcceeede92e755a1d41da6.html b/conservancy/content/projects/policies/conservancy-travel-policy.44cea2c1e51c72e115dcceeede92e755a1d41da6.html similarity index 100% rename from conservancy/static/projects/policies/conservancy-travel-policy.44cea2c1e51c72e115dcceeede92e755a1d41da6.html rename to conservancy/content/projects/policies/conservancy-travel-policy.44cea2c1e51c72e115dcceeede92e755a1d41da6.html diff --git a/conservancy/static/projects/policies/conservancy-travel-policy.4b21de38c2eab014dbfb776460c7600716bd6653.html b/conservancy/content/projects/policies/conservancy-travel-policy.4b21de38c2eab014dbfb776460c7600716bd6653.html similarity index 100% rename from conservancy/static/projects/policies/conservancy-travel-policy.4b21de38c2eab014dbfb776460c7600716bd6653.html rename to conservancy/content/projects/policies/conservancy-travel-policy.4b21de38c2eab014dbfb776460c7600716bd6653.html diff --git a/conservancy/static/projects/policies/conservancy-travel-policy.676ecf976cff8bf611cc045e6f351ce36f1009bb.html b/conservancy/content/projects/policies/conservancy-travel-policy.676ecf976cff8bf611cc045e6f351ce36f1009bb.html similarity index 100% rename from conservancy/static/projects/policies/conservancy-travel-policy.676ecf976cff8bf611cc045e6f351ce36f1009bb.html rename to conservancy/content/projects/policies/conservancy-travel-policy.676ecf976cff8bf611cc045e6f351ce36f1009bb.html diff --git a/conservancy/static/projects/policies/conservancy-travel-policy.783dcdd92fc61f3f150e1c65782c0fe527c8ff52.html b/conservancy/content/projects/policies/conservancy-travel-policy.783dcdd92fc61f3f150e1c65782c0fe527c8ff52.html similarity index 100% rename from conservancy/static/projects/policies/conservancy-travel-policy.783dcdd92fc61f3f150e1c65782c0fe527c8ff52.html rename to conservancy/content/projects/policies/conservancy-travel-policy.783dcdd92fc61f3f150e1c65782c0fe527c8ff52.html diff --git a/conservancy/static/projects/policies/conservancy-travel-policy.96a0a68c8e10ab4ea1f68faaf6573c141bbe7614.html b/conservancy/content/projects/policies/conservancy-travel-policy.96a0a68c8e10ab4ea1f68faaf6573c141bbe7614.html similarity index 100% rename from conservancy/static/projects/policies/conservancy-travel-policy.96a0a68c8e10ab4ea1f68faaf6573c141bbe7614.html rename to conservancy/content/projects/policies/conservancy-travel-policy.96a0a68c8e10ab4ea1f68faaf6573c141bbe7614.html diff --git a/conservancy/static/projects/policies/conservancy-travel-policy.9ef7fadc65c41438dd5dfeec3544bf80b53e4cea.html b/conservancy/content/projects/policies/conservancy-travel-policy.9ef7fadc65c41438dd5dfeec3544bf80b53e4cea.html similarity index 100% rename from conservancy/static/projects/policies/conservancy-travel-policy.9ef7fadc65c41438dd5dfeec3544bf80b53e4cea.html rename to conservancy/content/projects/policies/conservancy-travel-policy.9ef7fadc65c41438dd5dfeec3544bf80b53e4cea.html diff --git a/conservancy/static/projects/policies/conservancy-travel-policy.b78549cbc630463374e2bd50db187eedda9b75bd.html b/conservancy/content/projects/policies/conservancy-travel-policy.b78549cbc630463374e2bd50db187eedda9b75bd.html similarity index 100% rename from conservancy/static/projects/policies/conservancy-travel-policy.b78549cbc630463374e2bd50db187eedda9b75bd.html rename to conservancy/content/projects/policies/conservancy-travel-policy.b78549cbc630463374e2bd50db187eedda9b75bd.html diff --git a/conservancy/static/projects/policies/conservancy-travel-policy.bfc2754decec9bf4b88c10accd4e44b33e4664e6.html b/conservancy/content/projects/policies/conservancy-travel-policy.bfc2754decec9bf4b88c10accd4e44b33e4664e6.html similarity index 100% rename from conservancy/static/projects/policies/conservancy-travel-policy.bfc2754decec9bf4b88c10accd4e44b33e4664e6.html rename to conservancy/content/projects/policies/conservancy-travel-policy.bfc2754decec9bf4b88c10accd4e44b33e4664e6.html diff --git a/conservancy/static/projects/policies/conservancy-travel-policy.d3640cc7e0181236b3b5a988328ab2ae82cd7c03.html b/conservancy/content/projects/policies/conservancy-travel-policy.d3640cc7e0181236b3b5a988328ab2ae82cd7c03.html similarity index 100% rename from conservancy/static/projects/policies/conservancy-travel-policy.d3640cc7e0181236b3b5a988328ab2ae82cd7c03.html rename to conservancy/content/projects/policies/conservancy-travel-policy.d3640cc7e0181236b3b5a988328ab2ae82cd7c03.html diff --git a/conservancy/static/projects/policies/conservancy-travel-policy.efb14f1e18273e4f164e3b3a689a086fd511ba26.html b/conservancy/content/projects/policies/conservancy-travel-policy.efb14f1e18273e4f164e3b3a689a086fd511ba26.html similarity index 100% rename from conservancy/static/projects/policies/conservancy-travel-policy.efb14f1e18273e4f164e3b3a689a086fd511ba26.html rename to conservancy/content/projects/policies/conservancy-travel-policy.efb14f1e18273e4f164e3b3a689a086fd511ba26.html diff --git a/conservancy/static/projects/policies/conservancy-travel-policy.html b/conservancy/content/projects/policies/conservancy-travel-policy.html similarity index 100% rename from conservancy/static/projects/policies/conservancy-travel-policy.html rename to conservancy/content/projects/policies/conservancy-travel-policy.html diff --git a/conservancy/static/projects/policies/index.html b/conservancy/content/projects/policies/index.html similarity index 100% rename from conservancy/static/projects/policies/index.html rename to conservancy/content/projects/policies/index.html diff --git a/conservancy/static/projects/policies/publish-policy.py b/conservancy/content/projects/policies/publish-policy.py similarity index 100% rename from conservancy/static/projects/policies/publish-policy.py rename to conservancy/content/projects/policies/publish-policy.py diff --git a/conservancy/static/projects/services/index.html b/conservancy/content/projects/services/index.html similarity index 100% rename from conservancy/static/projects/services/index.html rename to conservancy/content/projects/services/index.html diff --git a/conservancy/static/sustainer/event.html b/conservancy/content/sustainer/event.html similarity index 100% rename from conservancy/static/sustainer/event.html rename to conservancy/content/sustainer/event.html diff --git a/conservancy/static/sustainer/original-supporter-appeal.html b/conservancy/content/sustainer/original-supporter-appeal.html similarity index 100% rename from conservancy/static/sustainer/original-supporter-appeal.html rename to conservancy/content/sustainer/original-supporter-appeal.html diff --git a/conservancy/static/sustainer/thank-you-event.html b/conservancy/content/sustainer/thank-you-event.html similarity index 100% rename from conservancy/static/sustainer/thank-you-event.html rename to conservancy/content/sustainer/thank-you-event.html diff --git a/conservancy/static/sustainer/thank-you.html b/conservancy/content/sustainer/thank-you.html similarity index 100% rename from conservancy/static/sustainer/thank-you.html rename to conservancy/content/sustainer/thank-you.html diff --git a/conservancy/settings/base.py b/conservancy/settings/base.py index d4eb2cf9a174bfba2cbab00dc1b0254776761a7b..2253b0465f8ce1374bf67383bbf31b7100d0045f 100644 --- a/conservancy/settings/base.py +++ b/conservancy/settings/base.py @@ -99,7 +99,6 @@ TEMPLATES = [ 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': [ BASE_DIR / 'templates', - BASE_DIR / 'static', ], 'APP_DIRS': True, 'OPTIONS': { diff --git a/conservancy/supporter/urls.py b/conservancy/supporter/urls.py index 036446fcaab3f31528b5009b0d8f75c5bb86ea79..fdbae119b7f3c0a4611de3c17d9a0c70de811e5e 100644 --- a/conservancy/supporter/urls.py +++ b/conservancy/supporter/urls.py @@ -1,12 +1,10 @@ -from django.urls import path, re_path +from django.urls import path from django.views.generic import TemplateView from . import views as supp_views -from .. import views as static_views urlpatterns = [ path('', supp_views.index), path('banner/', TemplateView.as_view(template_name='supporter/banners.html')), path('banners/', TemplateView.as_view(template_name='supporter/banners.html')), - re_path(r'', static_views.index), ] diff --git a/conservancy/urls.py b/conservancy/urls.py index 0189519d1060581f163d41165e4d37ff58ad9191..a23c6baa2cb5a7603e2b0b3c73097a6b0f531024 100644 --- a/conservancy/urls.py +++ b/conservancy/urls.py @@ -52,8 +52,9 @@ urlpatterns = [ re_path(r'^GiveUpGitHub/', static_views.index), re_path(r'^learn/', static_views.index), re_path(r'^npoacct/', static_views.index, {'fundraiser_sought': 'npoacct'}), - re_path(r'^overview/', static_views.index), + re_path(r'^overview/', static_views.index), # Unused? re_path(r'^press/', static_views.index), re_path(r'^privacy-policy/', static_views.index), re_path(r'^projects/', static_views.index), + re_path(r'^sustainer/', static_views.index), ] diff --git a/conservancy/views.py b/conservancy/views.py index 21059710f9d131c2ca22a827bf4026c079f418a5..560eaf61f9b0b75728fc9a41332e989c5c42f00f 100644 --- a/conservancy/views.py +++ b/conservancy/views.py @@ -1,8 +1,8 @@ import mimetypes from django.conf import settings -from django.http import FileResponse, Http404, HttpResponseRedirect -from django.template.response import TemplateResponse +from django.http import FileResponse, Http404, HttpResponse, HttpResponseRedirect +from django.template import RequestContext, Template from .local_context_processors import fundgoal_lookup @@ -27,8 +27,7 @@ def index(request, *args, **kwargs): infrastructure. If it finds a file but it's not a template, it will serve the file as-is. """ - # The name "static" has no connection to Django staticfiles. - base_path = settings.BASE_DIR / 'static' + base_path = settings.BASE_DIR / 'content' path = request.path.lstrip('/') if path.endswith('/'): path += 'index.html' @@ -43,11 +42,13 @@ def index(request, *args, **kwargs): if not is_template: return FileResponse(open(full_path, 'rb')) else: - context = kwargs.copy() try: - context['fundgoal'] = fundgoal_lookup(kwargs['fundraiser_sought']) + kwargs['fundgoal'] = fundgoal_lookup(kwargs['fundraiser_sought']) except KeyError: pass - # Maybe this should open() the template file directly so that these - # don't have to be included in the global template TEMPLATES.DIRS? - return TemplateResponse(request, path, context) + # These template are intentionally not in the template loader path, so + # we open them directly, rather than using the template loader. + with open(full_path) as t: + template = Template(t.read()) + context = RequestContext(request, kwargs) + return HttpResponse(template.render(context))