Changeset - 2bf594b86cb1
www/conservancy/apps/blog/urls.py
Show inline comments
 
from django.conf.urls.defaults import *
 
from django.conf.urls import patterns, url, include
 
from models import Entry, EntryTag # relative import
 
from views import last_name # relative import
 
from conservancy.apps.staff.models import Person
 
from datetime import datetime
 
from views import last_name, BlogYearArchiveView, BlogMonthArchiveView, BlogDayArchiveView, BlogDateDetailView
 

	
 
extra_context = {}
 

	
...
 
@@ -12,12 +12,17 @@ info_dict = {
 
    'extra_context': extra_context,
 
}
 

	
 
urlpatterns = patterns('django.views.generic.date_based',
 
   (r'^(?P<year>\d{4})/(?P<month>[a-z]{3})/(?P<day>\w{1,2})/(?P<slug>[-\w]+)/$', 'object_detail', dict(info_dict, slug_field='slug')),
 
   (r'^(?P<year>\d{4})/(?P<month>[a-z]{3})/(?P<day>\w{1,2})/$', 'archive_day', info_dict),
 
   (r'^(?P<year>\d{4})/(?P<month>[a-z]{3})/$', 'archive_month', info_dict),
 
   (r'^(?P<year>\d{4})/$', 'archive_year', dict(info_dict,
 
                                                make_object_list=True)),
 
# urlpatterns = patterns('django.views.generic.date_based',
 
urlpatterns = patterns('',
 
   # (r'^(?P<year>\d{4})/(?P<month>[a-z]{3})/(?P<day>\w{1,2})/(?P<slug>[-\w]+)/$', 'object_detail', dict(info_dict, slug_field='slug')),
 
   # (r'^(?P<year>\d{4})/(?P<month>[a-z]{3})/(?P<day>\w{1,2})/$', 'archive_day', info_dict),
 
   # (r'^(?P<year>\d{4})/(?P<month>[a-z]{3})/$', 'archive_month', info_dict),
 
   # (r'^(?P<year>\d{4})/$', 'archive_year', dict(info_dict,
 
   #                                              make_object_list=True)),
 
   (r'^(?P<year>\d{4})/(?P<month>[a-z]{3})/(?P<day>\w{1,2})/(?P<slug>[-\w]+)/$', BlogDateDetailView.as_view(**info_dict)),
 
   (r'^(?P<year>\d{4})/(?P<month>[a-z]{3})/(?P<day>\w{1,2})/$', BlogDayArchiveView.as_view(**info_dict)),
 
   (r'^(?P<year>\d{4})/(?P<month>[a-z]{3})/$', BlogMonthArchiveView.as_view(**info_dict)),
 
   (r'^(?P<year>\d{4})/$', BlogYearArchiveView.as_view(**info_dict)),
 
)
 

	
 
urlpatterns += patterns('conservancy.apps.blog.views',
www/conservancy/apps/blog/views.py
Show inline comments
 
from models import Entry, EntryTag # relative import
 
from django.views.generic.list_detail import object_list
 
# from django.views.generic.list_detail import object_list
 
from django.views.generic import ListView
 
from django.views.generic.dates import YearArchiveView, MonthArchiveView, DayArchiveView, DateDetailView
 
from conservancy.apps.staff.models import Person
 
from django.shortcuts import get_object_or_404, render_to_response
 
from datetime import datetime
...
 
@@ -12,6 +14,15 @@ def OR_filter(field_name, objs):
 
def last_name(person):
 
    return person.formal_name.rpartition(' ')[2]
 

	
 
class BlogListView(ListView):
 
    extra_context = {}
 
    
 
    def get_context_data(self, **kwargs):
 
        context = super(BlogListView, self).get_context_data(**kwargs)
 
        # context['key'] = 'value'
 
        context.update(self.extra_context)
 
        return context
 
                                    
 
def custom_index(request, queryset, *args, **kwargs):
 
    """Blog list view that allows scrolling and also shows an index by
 
    year.
...
 
@@ -50,7 +61,11 @@ def custom_index(request, queryset, *args, **kwargs):
 
        date_list = queryset.dates(date_field, 'year')
 
        extra_context['date_list'] = date_list
 

	
 
    return object_list(request, queryset, *args, **kwargs)
 
    # return object_list(request, queryset, *args, **kwargs)
 
    kwargs['queryset'] = queryset
 
    kwargs['extra_context'] = extra_context
 
    callable = BlogListView.as_view(**kwargs)
 
    return callable(request)
 

	
 
def techblog_redirect(request):
 
    """Redirect from the old 'techblog' to the new blog
...
 
@@ -95,9 +110,46 @@ def relative_redirect(request, path):
 
    from django import http
 
    from django.conf import settings
 

	
 
    host = http.get_host(request)
 
    host = request.get_host()
 
    if settings.FORCE_CANONICAL_HOSTNAME:
 
        host = settings.FORCE_CANONICAL_HOSTNAME
 

	
 
    url = "%s://%s%s" % (request.is_secure() and 'https' or 'http', host, path)
 
    return http.HttpResponseRedirect(url)
 

	
 
class BlogYearArchiveView(YearArchiveView):
 
    make_object_list = True
 
    allow_future = True
 
    extra_context = {}
 
    
 
    def get_context_data(self, **kwargs):
 
        context = super(BlogYearArchiveView, self).get_context_data(**kwargs)
 
        context.update(self.extra_context)
 
        return context
 

	
 
class BlogMonthArchiveView(MonthArchiveView):
 
    allow_future = True
 
    extra_context = {}
 
    
 
    def get_context_data(self, **kwargs):
 
        context = super(BlogMonthArchiveView, self).get_context_data(**kwargs)
 
        context.update(self.extra_context)
 
        return context
 

	
 
class BlogDayArchiveView(DayArchiveView):
 
    allow_future = True
 
    extra_context = {}
 
    
 
    def get_context_data(self, **kwargs):
 
        context = super(BlogDayArchiveView, self).get_context_data(**kwargs)
 
        context.update(self.extra_context)
 
        return context
 

	
 
class BlogDateDetailView(DateDetailView):
 
    allow_future = True
 
    extra_context = {}
 
    
 
    def get_context_data(self, **kwargs):
 
        context = super(BlogDateDetailView, self).get_context_data(**kwargs)
 
        context.update(self.extra_context)
 
        return context
www/conservancy/apps/contacts/urls.py
Show inline comments
 
from django.conf.urls.defaults import *
 
from django.conf.urls import patterns, url, include
 

	
 
urlpatterns = patterns('conservancy.apps.contacts.views',
 
   (r'^/?$', 'subscribe'),
www/conservancy/apps/events/models.py
Show inline comments
...
 
@@ -19,14 +19,14 @@ class EventTag(models.Model):
 
class PastEventManager(models.Manager):
 
    """Returns all past events"""
 

	
 
    def get_query_set(self):
 
        return super(PastEventManager, self).get_query_set().filter(date__lt=datetime.today())
 
    def get_queryset(self):
 
        return super(PastEventManager, self).get_queryset().filter(date__lt=datetime.today())
 

	
 
class FutureEventManager(models.Manager):
 
    """Returns all future events"""
 

	
 
    def get_query_set(self):
 
        return super(FutureEventManager, self).get_query_set().filter(date__gte=datetime.today())
 
    def get_queryset(self):
 
        return super(FutureEventManager, self).get_queryset().filter(date__gte=datetime.today())
 

	
 
class Event(models.Model):
 
    """Model for Conservancy staff member events (presentations, etc)"""
...
 
@@ -78,7 +78,8 @@ class EventMedia(models.Model):
 
                                       ('V', 'Video')))
 
    local = models.CharField(max_length=300, blank=True,
 
                             help_text="Local filename of the resource.  File should be uploaded into the static directory that corresponds to the event.")
 
    remote = models.URLField(blank=True, verify_exists=False,
 
    # verify_exists removed https://docs.djangoproject.com/en/1.7/releases/1.4/
 
    remote = models.URLField(blank=True,
 
                             help_text="Remote URL of the resource.  Required if 'local' is not given.")
 
    novel = models.BooleanField(help_text="Is it a new piece of media or another form of an old one?  If it is new it will be included in the event-media RSS feed and shown on the front page for a bit.")
 

	
www/conservancy/apps/events/urls.py
Show inline comments
 
from django.conf.urls.defaults import *
 
from django.conf.urls import patterns, url, include
 
from models import Event # relative import
 

	
 
info_dict = {
...
 
@@ -7,13 +7,18 @@ info_dict = {
 
    'allow_future': True,
 
}
 

	
 
urlpatterns = patterns('django.views.generic.date_based',
 
    (r'^(?P<year>\d{4})/$', 'archive_year', dict(info_dict,
 
                                                 make_object_list=True)),
 
)
 
# FIXME -- see blog and news for examples
 
# urlpatterns = patterns('django.views.generic.date_based',
 
#     (r'^(?P<year>\d{4})/$', 'archive_year', dict(info_dict,
 
#                                                  make_object_list=True)),
 
# )
 

	
 
# urlpatterns += patterns('conservancy.apps.events.views',
 
#     (r'^/?$', 'custom_index', dict(info_dict, queryset=Event.past.all(), paginate_by=10)),
 
#     (r'^(?P<year>\d{4})/(?P<slug>[-\w]+)/$', 'event_detail', dict(info_dict, slug_field='slug')),
 
#     (r'^ics/$', 'future_event_ics', info_dict),
 
# )
 

	
 
urlpatterns += patterns('conservancy.apps.events.views',
 
    (r'^/?$', 'custom_index', dict(info_dict, queryset=Event.past.all(), paginate_by=10)),
 
    (r'^(?P<year>\d{4})/(?P<slug>[-\w]+)/$', 'event_detail', dict(info_dict, slug_field='slug')),
 
    (r'^ics/$', 'future_event_ics', info_dict),
 
urlpatterns = patterns('conservancy.apps.events.views',
 
    (r'^.*$', 'custom_index', dict(info_dict, queryset=Event.past.all(), paginate_by=10)),
 
)
www/conservancy/apps/events/views.py
Show inline comments
 
from django.views.generic.list_detail import object_list
 
# from django.views.generic.list_detail import object_list
 
from django.shortcuts import render_to_response
 
from django.http import Http404, HttpResponse
 
from django.template import loader
 
from django.core.exceptions import ObjectDoesNotExist
 
from models import Event # relative import
 
# for debugging...
 
from django.http import HttpResponse
 

	
 
def event_detail(request, year, slug, queryset, **kwargs):
 
    """This view shows event detail.
...
 
@@ -35,7 +37,8 @@ def custom_index(request, queryset, *args, **kwargs):
 
    del kwargs['date_field']
 
    del kwargs['allow_future']
 

	
 
    return object_list(request, queryset, *args, **kwargs)
 
    # return object_list(request, queryset, *args, **kwargs)
 
    return HttpResponse("FIXME: events must be updated like blog and news.")
 

	
 
def future_event_ics(request, queryset, *args, **kwargs):
 
    """ICS calendar view of future events
www/conservancy/apps/news/models.py
Show inline comments
...
 
@@ -74,8 +74,8 @@ class ExternalArticleTag(models.Model):
 
        return self.label
 

	
 
class PublicExternalArticleManager(models.Manager):
 
    def get_query_set(self):
 
        return super(PublicExternalArticleManager, self).get_query_set().filter(visible=True)
 
    def get_queryset(self):
 
        return super(PublicExternalArticleManager, self).get_queryset().filter(visible=True)
 

	
 
class ExternalArticle(models.Model):
 
    """A system for displaying Conservancy news mentions on the site.
...
 
@@ -87,7 +87,8 @@ class ExternalArticle(models.Model):
 
    info = models.CharField(help_text="subscribers only? audio? pdf warning?",
 
                            blank=True, max_length=300)
 
    publication = models.CharField("source of article", max_length=300)
 
    url = models.URLField(blank=True, verify_exists=False)
 
    # verify_exists removed https://docs.djangoproject.com/en/1.7/releases/1.4/
 
    url = models.URLField(blank=True)
 
    date = models.DateField()
 
    visible = models.BooleanField(help_text="Whether to display on website")
 

	
www/conservancy/apps/news/urls.py
Show inline comments
...
 
@@ -17,9 +17,10 @@
 
# along with this program in a file in the toplevel directory called
 
# "AGPLv3".  If not, see <http://www.gnu.org/licenses/>.
 

	
 
from django.conf.urls.defaults import *
 
from django.conf.urls import patterns, url, include
 
from django.conf import settings
 
from models import PressRelease, ExternalArticle # relative import
 
from views import NewsYearArchiveView, NewsMonthArchiveView, NewsDayArchiveView, NewsDateDetailView
 

	
 
info_dict = {
 
    'queryset': PressRelease.objects.all().filter(sites__id__exact=settings.SITE_ID),
...
 
@@ -30,12 +31,16 @@ external_article_dict = {
 
    'articles': ExternalArticle.objects.all()
 
}
 

	
 
urlpatterns = patterns('django.views.generic.date_based',
 
   (r'^(?P<year>\d{4})/(?P<month>[a-z]{3})/(?P<day>\w{1,2})/(?P<slug>[-\w]+)/$', 'object_detail', dict(info_dict, slug_field='slug')),
 
   (r'^(?P<year>\d{4})/(?P<month>[a-z]{3})/(?P<day>\w{1,2})/$', 'archive_day', info_dict),
 
   (r'^(?P<year>\d{4})/(?P<month>[a-z]{3})/$', 'archive_month', info_dict),
 
   (r'^(?P<year>\d{4})/$', 'archive_year', dict(info_dict,
 
                                                make_object_list=True)),
 
urlpatterns = patterns('',
 
#    (r'^(?P<year>\d{4})/(?P<month>[a-z]{3})/(?P<day>\w{1,2})/(?P<slug>[-\w]+)/$', 'conservancy.apps.news.views.object_detail', info_dict),
 
   (r'^(?P<year>\d{4})/(?P<month>[a-z]{3})/(?P<day>\w{1,2})/(?P<slug>[-\w]+)/$', NewsDateDetailView.as_view(**info_dict)),
 
#   (r'^(?P<year>\d{4})/(?P<month>[a-z]{3})/(?P<day>\w{1,2})/$', 'conservancy.apps.news.views.archive_day', info_dict),
 
   (r'^(?P<year>\d{4})/(?P<month>[a-z]{3})/(?P<day>\w{1,2})/$', NewsDayArchiveView.as_view(**info_dict)),
 
#   (r'^(?P<year>\d{4})/(?P<month>[a-z]{3})/$', 'conservancy.apps.news.views.archive_month', info_dict),
 
   (r'^(?P<year>\d{4})/(?P<month>[a-z]{3})/$', NewsMonthArchiveView.as_view(**info_dict)),
 
#   (r'^(?P<year>\d{4})/$', 'conservancy.apps.news.views.archive_year',
 
#    dict(info_dict, make_object_list=True)),
 
   (r'^(?P<year>\d{4})/$', NewsYearArchiveView.as_view(**info_dict)),
 
)
 

	
 
urlpatterns += patterns('',
www/conservancy/apps/news/views.py
Show inline comments
 
from django.views.generic.list_detail import object_list
 
# from django.views.generic.list_detail import object_list
 
from django.views.generic import ListView
 
from django.views.generic.dates import YearArchiveView, MonthArchiveView, DayArchiveView, DateDetailView
 
from conservancy.apps.news.models import ExternalArticle
 
from conservancy.apps.events.models import Event
 
from datetime import datetime
 
# for debugging...
 
from django.http import HttpResponse
 

	
 

	
 
class NewsListView(ListView):
 
    extra_context = {}
 
    def get_context_data(self, **kwargs):
 
        context = super(NewsListView, self).get_context_data(**kwargs)
 
        # context['key'] = 'value'
 
        context.update(self.extra_context)
 
        return context
 
                                    
 
def custom_index(request, queryset, *args, **kwargs):
 
    """News index.  Calls a generic list view, but passes additional
 
    context including past and future events, and an index of news by
 
    year.
 
    """
 
    # debug = '<pre>This is news'
 
    # debug += '\nqueryset: ' + str(queryset)
 
    # debug += '\nargs: ' + str(args)
 
    # debug += '\nkwargs: ' + str(kwargs)
 
    # debug += '</pre>'
 
    # return HttpResponse(debug)
 

	
 
    articles = None
 
    #if not request.GET.has_key("page"):
...
 
@@ -28,8 +47,62 @@ def custom_index(request, queryset, *args, **kwargs):
 
                                         'past_events': past_events})
 
    del kwargs['date_field']
 

	
 
    return object_list(request, queryset, *args, **kwargs)
 
    # return object_list(request, queryset, *args, **kwargs)
 
    # callable = NewsListView.as_view(queryset=queryset,
 
    #                                 extra_context=kwargs,
 
    #                                 paginate_by=kwargs['paginate_by'])
 
    kwargs['queryset'] = queryset
 
    callable = NewsListView.as_view(**kwargs)
 
    return callable(request)
 

	
 
#    num_navigation = 3 # in each direction
 
#    page_navigation = range(max((page - num_navigation), 1),
 
#                            min((page + num_navigation), page_count) + 1)
 

	
 
class NewsYearArchiveView(YearArchiveView):
 
    # queryset = Article.objects.all()
 
    # date_field = "pub_date"
 
    make_object_list = True
 
    allow_future = True
 

	
 
# def archive_year(request, **kwargs):
 
#     callable = NewsYearArchiveView.as_view(**kwargs)
 
#     return callable(request)
 

	
 
class NewsMonthArchiveView(MonthArchiveView):
 
    allow_future = True
 

	
 
# def archive_month(request, **kwargs):
 
#     # return HttpResponse("archive_month")
 
#     callable = NewsMonthArchiveView.as_view(**kwargs)
 
#     return callable(request)
 

	
 
class NewsDayArchiveView(DayArchiveView):
 
    allow_future = True
 

	
 
# def archive_day(request, **kwargs):
 
#     # return HttpResponse("archive_day")
 
#     callable = NewsDayArchiveView.as_view(**kwargs)
 
#     return callable(request)
 

	
 
class NewsDateDetailView(DateDetailView):
 
    # extra_context = {}
 
    allow_future = True
 
    # slug_url_kwarg = 'slug'
 

	
 
    # def get_context_data(self, **kwargs):
 
    #     context = super(NewsDateDetailView, self).get_context_data(**kwargs)
 
    #     context.update(self.extra_context)
 
    #     return context
 

	
 
# def object_detail(request, **kwargs):
 
#     # extra_context = {}
 
#     # extra_context['slug'] = kwargs['slug']
 
#     # del kwargs['slug']
 
#     # kwargs['extra_context'] = extra_context
 
#     # return HttpResponse("object_detail: " + str(kwargs))
 
#     # slug = kwargs['slug']
 
#     # del kwargs['slug']
 
#     callable = NewsDateDetailView.as_view(**kwargs)
 
#     return callable(request)
 

	
www/conservancy/apps/podcast/admin.py
Show inline comments
 
deleted file
www/conservancy/apps/podcast/models.py
Show inline comments
 
deleted file
www/conservancy/apps/podcast/urls.py
Show inline comments
 
deleted file
www/conservancy/apps/podcast/views.py
Show inline comments
 
deleted file
www/conservancy/apps/summit_registration/urls.py
Show inline comments
 
from django.conf.urls.defaults import *
 
from django.conf.urls import patterns, url, include
 

	
 
urlpatterns = patterns('conservancy.apps.summit_registration.views',
 
   (r'^/?$', 'register'),
www/conservancy/apps/supporters/views.py
Show inline comments
 
from models import Supporter # relative import
 
from django.views.generic.list_detail import object_list
 
from django.shortcuts import get_object_or_404, render_to_response
 

	
www/conservancy/middleware.py
Show inline comments
 
from django.conf import settings
 
from django import http
 
from django.conf import settings
 
from django.utils.cache import patch_response_headers
 

	
 
class ForceCanonicalHostnameMiddleware(object):
...
 
@@ -19,7 +19,7 @@ class ForceCanonicalHostnameMiddleware(object):
 
            return http.HttpResponseRedirect(url)
 

	
 
        # Check for a redirect based on settings.APPEND_SLASH
 
        host = http.get_host(request)
 
        host = request.get_host()
 
        old_url = [host, request.path]
 
        new_url = old_url[:]
 
        # Append a slash if append_slash is set and the URL doesn't have a
www/conservancy/settings.py
Show inline comments
...
 
@@ -21,13 +21,28 @@ from djangocommonsettings import *
 

	
 
SITE_ID = 2
 
ROOT_URLCONF = 'conservancy.urls'
 
FORCE_CANONICAL_HOSTNAME = "sfconservancy.org"
 

	
 

	
 
# FORCE_CANONICAL_HOSTNAME = "sfconservancy.org"
 
FORCE_CANONICAL_HOSTNAME = False
 

	
 
ALLOWED_HOSTS = [ 'aspen.sfconservancy.org', 'sfconservancy.org' ]
 

	
 
REDIRECT_TABLE = {
 
    'www.sf-conservancy.org': 'sfconservancy.org',
 
}
 

	
 
try:
 
    from djangodebug import conservancy_hostname as FORCE_CANONICAL_HOSTNAME
 
except:
 
    pass
 
# import os
 
# BASE_DIR = os.path.dirname(os.path.dirname(__file__))
 

	
 
# from os.path import join
 
# TEMPLATE_DIRS = (
 
#     join(BASE_DIR,  'templates'),
 
# )
 
# NOTE: trailing comma is required to force this to be a tuple
 
TEMPLATE_DIRS = ( '/var/www/conservancy/templates', '/var/www/conservancy/static', )
 

	
 
# try:
 
#     from djangodebug import conservancy_hostname as FORCE_CANONICAL_HOSTNAME
 
# except:
 
#     pass
www/conservancy/static/__init__.py
Show inline comments
 
file renamed from www/conservancy/apps/podcast/__init__.py to www/conservancy/static/__init__.py
www/conservancy/static/error/401/index.html
Show inline comments
 
file renamed from www/conservancy/static/401error.html to www/conservancy/static/error/401/index.html
www/conservancy/static/error/403/index.html
Show inline comments
 
file renamed from www/conservancy/static/403error.html to www/conservancy/static/error/403/index.html
www/conservancy/static/error/404/index.html
Show inline comments
 
file renamed from www/conservancy/static/404error.html to www/conservancy/static/error/404/index.html
www/conservancy/static/error/500/index.html
Show inline comments
 
file renamed from www/conservancy/static/500error.html to www/conservancy/static/error/500/index.html
www/conservancy/static/views.py
Show inline comments
 
new file 100644
 
import os.path
 
from django.http import HttpResponse
 
from django.template import RequestContext, loader
 

	
 
def handler(request, errorcode):
 
    STATIC_ROOT = '/home/www/website/www/conservancy/static/'
 
    path = 'error/' + errorcode + '/index.html'
 
    fullpath = STATIC_ROOT + path
 
    if not os.path.exists(fullpath):
 
        return HttpResponse("Internal error: " + path)
 
    template = loader.get_template(path)
 
    context = RequestContext(request)
 
    return HttpResponse(template.render(context))
 

	
 
def handler401(request):
 
    return handler(request, '401')
 

	
 
def handler403(request):
 
    return handler(request, '403')
 

	
 
def handler404(request):
 
    return handler(request, '404')
 

	
 
def handler500(request):
 
    return handler(request, '500')
 

	
 
def index(request):
 
    # return HttpResponse("Hello, static world: " + request.get_full_path())
 
    path = request.get_full_path()
 
    path = path.lstrip('/')
 
    if path[-1:] == '/':
 
        path += 'index.html'
 
    STATIC_ROOT = '/home/www/website/www/conservancy/static/'
 
    fullpath = STATIC_ROOT + path
 
    if not os.path.exists(fullpath):
 
        # return HttpResponse("Sorry that's a 404: " + path)
 
        return handler404(request)
 
    template = loader.get_template(path)
 
    context = RequestContext(request)
 
    return HttpResponse(template.render(context))
 

	
 
def debug(request):
 
    path = request.get_full_path()
 
    path = path.lstrip('/')
 
    return HttpResponse("Hello, static world: " + path)
 

	
www/conservancy/urls.py
Show inline comments
...
 
@@ -17,11 +17,22 @@
 
# along with this program in a file in the toplevel directory called
 
# "AGPLv3".  If not, see <http://www.gnu.org/licenses/>.
 

	
 
from django.conf.urls.defaults import *
 
from django.conf.urls import patterns, url, include
 
from django.contrib import admin
 

	
 
# import conservancy.settings
 
from django.conf import settings
 
from conservancy.feeds import BlogFeed, PressReleaseFeed, OmnibusFeed
 
# from django.views.static import serve
 
# from django.conf.urls.static import static
 
# from django.contrib.staticfiles.urls import staticfiles_urlpatterns
 
# import conservancy.static.overview.views
 

	
 
handler404 = 'modpythoncustom.view404'
 
# handler404 = 'modpythoncustom.view404'
 
# handler401 = 'conservancy.static.views.handler401'
 
# handler403 = 'conservancy.static.views.handler403'
 
handler404 = 'conservancy.static.views.handler404'
 
# handler500 = 'conservancy.static.views.handler500'
 

	
 
admin.autodiscover()
 

	
...
 
@@ -38,4 +49,38 @@ urlpatterns = patterns('',
 
    (r'^feeds/?$', 'conservancy.feeds.view'),
 
    (r'^news(/|$)', include('conservancy.apps.news.urls')),
 
    (r'^blog(/|$)', include('conservancy.apps.blog.urls')),
 
    # formerly static templated things... (dirs with templates)
 
    (r'^error', 'conservancy.static.views.index'),
 
    (r'^about', 'conservancy.static.views.index'),
 
    (r'^donate', 'conservancy.static.views.index'),
 
    (r'^linux-compliance', 'conservancy.static.views.index'),
 
    (r'^members', 'conservancy.static.views.index'),
 
    (r'^npoacct', 'conservancy.static.views.index'),
 
    (r'^overview', 'conservancy.static.views.index'),
 
    (r'^privacy-policy', 'conservancy.static.views.index'),
 
    (r'^supporter', 'conservancy.static.views.index'),
 
)
 

	
 
# urlpatterns += url(regex  = r'^%s(?P<path>.*)$' % conservancy.settings.STATIC_URL[1:],
 
# urlpatterns += url(regex  = r'^/overview',
 
#                    view   = 'django.views.static.serve',
 
#                    kwargs = {'document_root': conservancy.settings.STATIC_ROOT,
 
#                              'show_indexes' : True})
 
# urlpatterns += (r'^(?P<path>.*)$', 'django.views.static.serve', 
 
# urlpatterns += (r'^overview/$', 'django.views.static.serve', 
 
#                 {'document_root': conservancy.settings.STATIC_ROOT,
 
#                  'show_indexes' : True})
 

	
 
# https://docs.djangoproject.com/en/1.7/howto/static-files/
 
#  + static(conservancy.settings.STATIC_URL, document_root=conservancy.settings.STATIC_ROOT)
 

	
 
# urlpatterns += staticfiles_urlpatterns()
 

	
 
# urlpatterns += static(settings.STATIC_URL, view='django.contrib.staticfiles.views.serve',
 
# urlpatterns += static('/', view='django.contrib.staticfiles.views.serve',
 
#                       document_root=settings.STATIC_ROOT,
 
#                       show_indexes=True)
 

	
 

	
 

	
 

	
www/conservancy_ssl_wrapper.py
Show inline comments
...
 
@@ -24,4 +24,4 @@ from os import environ
 
environ["DJANGO_SETTINGS_MODULE"] = 'conservancy_ssl.settings'
 
environ["CANONICAL_HOSTNAME"] = 'sfconservancy.org'
 

	
 
from modpythoncustom import *
 
# from modpythoncustom import *
www/conservancy_wrapper.py
Show inline comments
...
 
@@ -5,4 +5,4 @@ from os import environ
 
environ["DJANGO_SETTINGS_MODULE"] = 'conservancy.settings'
 
environ["CANONICAL_HOSTNAME"] = 'sfconservancy.org'
 

	
 
from modpythoncustom import *
 
# from modpythoncustom import *
www/wsgicustom.wsgi
Show inline comments
 
new file 100644
 
# wsgicustom.py
 

	
 
import os
 
import sys
 

	
 
sys.path = ['/var/www'] + sys.path
 
os.environ['DJANGO_SETTINGS_MODULE'] = 'conservancy.settings'
 

	
 
from django.core.wsgi import get_wsgi_application
 
application = get_wsgi_application()
0 comments (0 inline, 0 general)