summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Pointner <equinox@helsinki.at>2015-09-25 18:52:36 (GMT)
committerChristian Pointner <equinox@helsinki.at>2015-09-25 18:52:36 (GMT)
commit2a40af2011cca2defd64254806970cf376a760a7 (patch)
tree316ef2330a6fc53b41159b1e8f675b29d315eabe
parent821a356f1a8a36560f6731a716c65b5c80553379 (diff)
fixed imports for django 1.7
-rw-r--r--nop/urls.py2
-rw-r--r--program/urls.py14
-rw-r--r--program/views.py15
-rw-r--r--pv/settings.py1
-rw-r--r--pv/urls.py2
-rw-r--r--pv/wsgi.py2
6 files changed, 19 insertions, 17 deletions
diff --git a/nop/urls.py b/nop/urls.py
index 0d7f279..85857ce 100644
--- a/nop/urls.py
+++ b/nop/urls.py
@@ -1,4 +1,4 @@
-from django.conf.urls.defaults import *
+from django.conf.urls import patterns, url, include
from views import get, get_current, nop_form
import os
diff --git a/program/urls.py b/program/urls.py
index d5af119..94096ff 100644
--- a/program/urls.py
+++ b/program/urls.py
@@ -1,8 +1,8 @@
from django.conf import settings
-from django.conf.urls.defaults import *
+from django.conf.urls import patterns, url, include
from django.db.models import Q
from django.views.decorators.cache import cache_page
-from django.views.generic.list_detail import object_detail, object_list
+from django.views.generic.detail import DetailView
from models import Host, Show, TimeSlot
from views import current_show, day_schedule, recommendations, show_list, \
@@ -33,21 +33,21 @@ urlpatterns = patterns('',
day_schedule),
url(r'^(?P<year>\d{4})/(?P<week>\d{1,2})/?$',
week_schedule),
- url(r'^current_box/?$', cache_page(current_show, 60)),
+ url(r'^current_box/?$', cache_page(60)(current_show)),
url(r'^hosts/?$',
- object_list,
+ DetailView,
dict(hosts_dict, template_name='host_list.html')),
- url(r'^hosts/(?P<object_id>\d+)/?$', object_detail,
+ url(r'^hosts/(?P<object_id>\d+)/?$', DetailView,
dict(hosts_dict, template_name='host_detail.html'),
name='host-detail'),
url(r'^tips/?$', recommendations),
url(r'^tips_box/?$', recommendations,
recommendations_dict),
url(r'^shows/?$', show_list),
- url(r'^shows/(?P<slug>[\w-]+)/?$', object_detail,
+ url(r'^shows/(?P<slug>[\w-]+)/?$', DetailView,
dict(shows_dict, template_name='show_detail.html'),
name='show-detail'),
- url(r'^(?P<object_id>\d+)/?$', object_detail,
+ url(r'^(?P<object_id>\d+)/?$', DetailView,
dict(timeslots_dict,
template_name='timeslot_detail.html'),
name='timeslot-detail'),
diff --git a/program/views.py b/program/views.py
index e01868a..2305fdd 100644
--- a/program/views.py
+++ b/program/views.py
@@ -1,7 +1,8 @@
from datetime import date, datetime, time, timedelta
import json
-from django.views.generic import list_detail, simple
+from django.views.generic.base import TemplateView
+from django.views.generic.detail import DetailView
from django.shortcuts import get_object_or_404
from django.db.models import Q
from django.http import HttpResponse
@@ -33,7 +34,7 @@ def show_list(request):
queryset = queryset.filter(showtopic=showtopic)
- return list_detail.object_list(request, queryset=queryset,
+ return DetailView(request, queryset=queryset,
template_object_name='show',
template_name='show_list.html')
@@ -46,7 +47,7 @@ def recommendations(request, template_name='recommendations.html'):
start__range=(now, end)) |
Q(show__broadcastformat__slug='sondersendung',
start__range=(now, end))).order_by('start')[:20]
- return list_detail.object_list(request, queryset=queryset,
+ return DetailView(request, queryset=queryset,
template_name=template_name,
template_object_name='recommendation')
@@ -93,7 +94,7 @@ def day_schedule(request, year=None, month=None, day=None):
else:
extra_context['timeslots'] = timeslots
- return simple.direct_to_template(request, extra_context=extra_context,
+ return TemplateView(request, extra_context=extra_context,
template='day_schedule.html')
@@ -108,7 +109,7 @@ def current_show(request):
next=next,
after_next=after_next)
- return simple.direct_to_template(request, template='boxes/current.html',
+ return TemplateView(request, template='boxes/current.html',
extra_context=extra_context)
@@ -151,7 +152,7 @@ def week_schedule(request, year=None, week=None):
extra_context['next_w4'] = datetime.strftime(monday + timedelta(days=28),
'%G/%V')
- return simple.direct_to_template(request, template='week_schedule.html',
+ return TemplateView(request, template='week_schedule.html',
extra_context=extra_context)
@@ -161,7 +162,7 @@ def styles(request):
extra_context['musicfocus'] = MusicFocus.objects.all()
extra_context['showinformation'] = ShowInformation.objects.all()
extra_context['showtopic'] = ShowTopic.objects.all()
- return simple.direct_to_template(request, template='styles.css',
+ return TemplateView(request, template='styles.css',
mimetype='text/css',
extra_context=extra_context)
diff --git a/pv/settings.py b/pv/settings.py
index 7ef0067..de116c2 100644
--- a/pv/settings.py
+++ b/pv/settings.py
@@ -36,6 +36,7 @@ LOCALE_PATHS = os.path.join(PROJECT_DIR, 'locale')
MEDIA_ROOT = os.path.join(PROJECT_DIR, 'site_media')
MEDIA_URL = '/site_media/'
+STATIC_ROOT = os.path.join(PROJECT_DIR, 'static')
STATIC_URL = '/static/'
SECRET_KEY = ''
diff --git a/pv/urls.py b/pv/urls.py
index 792e9e9..8d97fb3 100644
--- a/pv/urls.py
+++ b/pv/urls.py
@@ -1,5 +1,5 @@
from django.conf import settings
-from django.conf.urls.defaults import *
+from django.conf.urls import patterns, url, include
from django.contrib import admin
admin.autodiscover()
diff --git a/pv/wsgi.py b/pv/wsgi.py
index 0708263..f704d30 100644
--- a/pv/wsgi.py
+++ b/pv/wsgi.py
@@ -16,7 +16,7 @@ framework.
import os
import sys
-sys.path.append('/var/www/pv')
+sys.path.append('/srv/pv/pv')
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "pv.settings")