From dd2774211489720fddcb9bdf1c37e93391057b19 Mon Sep 17 00:00:00 2001 From: Ben Sturmfels Date: Wed, 6 Mar 2024 18:46:40 +1100 Subject: [PATCH] Move Python code out of the "conservancy/static" directory Having Python code in "conservancy/static" is a bit suprising to people familiar with Django. The name "static" is usually reserved for assets like CSS, JS and images. I'm moving `conservancy/static/views.py` to `conservancy/views.py` and removing `conservancy/static/__init__.py`. --- conservancy/static/__init__.py | 0 conservancy/supporter/urls.py | 2 +- conservancy/urls.py | 2 +- conservancy/{static => }/views.py | 2 +- 4 files changed, 3 insertions(+), 3 deletions(-) delete mode 100644 conservancy/static/__init__.py rename conservancy/{static => }/views.py (97%) diff --git a/conservancy/static/__init__.py b/conservancy/static/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/conservancy/supporter/urls.py b/conservancy/supporter/urls.py index f03af00b..83541a32 100644 --- a/conservancy/supporter/urls.py +++ b/conservancy/supporter/urls.py @@ -2,7 +2,7 @@ from django.conf.urls import url from django.views.generic import TemplateView from . import views as supp_views -from ..static import views as static_views +from .. import views as static_views INDEX_VIEW = supp_views.index urlpatterns = [ diff --git a/conservancy/urls.py b/conservancy/urls.py index d1441a62..1e9e7b71 100644 --- a/conservancy/urls.py +++ b/conservancy/urls.py @@ -23,7 +23,7 @@ from django.contrib import admin from . import feeds, frontpage, sponsors from .fundgoal import views as fundgoal_views -from .static import views as static_views +from . import views as static_views admin.autodiscover() diff --git a/conservancy/static/views.py b/conservancy/views.py similarity index 97% rename from conservancy/static/views.py rename to conservancy/views.py index 54b8f5f6..2913f2b1 100644 --- a/conservancy/static/views.py +++ b/conservancy/views.py @@ -4,7 +4,7 @@ import os.path from django.http import HttpResponse from django.template.response import TemplateResponse -from ..local_context_processors import fundgoal_lookup +from .local_context_processors import fundgoal_lookup STATIC_ROOT = os.path.abspath(os.path.dirname(__file__)) FILESYSTEM_ENCODING = 'utf-8'