Changeset - dd2774211489
[Not reviewed]
2 2 1
Ben Sturmfels (bsturmfels) - 2 months ago 2024-03-06 07:46:40
ben@sturm.com.au
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`.
4 files changed with 3 insertions and 3 deletions:
0 comments (0 inline, 0 general)
conservancy/static/__init__.py
Show inline comments
 
deleted file
conservancy/supporter/urls.py
Show inline comments
 
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 = [
 
    url(r'^$', INDEX_VIEW),
 
    url(r'^banners?/?$', TemplateView.as_view(template_name='supporter/banners.html')),
 
]
conservancy/urls.py
Show inline comments
...
 
@@ -20,13 +20,13 @@
 
from django.conf.urls import url
 
from django.urls import include, path
 
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()
 

	
 
urlpatterns = [
 
    url(r'^$', frontpage.view),
 
    url(r'^sponsors$', frontpage.view),
conservancy/views.py
Show inline comments
 
file renamed from conservancy/static/views.py to conservancy/views.py
 
import mimetypes
 
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'
 

	
 
def handler(request, errorcode):
 
    path = os.path.join('error', str(errorcode), 'index.html')
0 comments (0 inline, 0 general)