summaryrefslogtreecommitdiff
path: root/pv
diff options
context:
space:
mode:
Diffstat (limited to 'pv')
-rw-r--r--pv/settings.py42
-rw-r--r--pv/urls.py17
-rw-r--r--pv/wsgi.py5
3 files changed, 41 insertions, 23 deletions
diff --git a/pv/settings.py b/pv/settings.py
index cf1da74..e967b39 100644
--- a/pv/settings.py
+++ b/pv/settings.py
@@ -1,12 +1,12 @@
# Django settings for pv project.
import os.path
+
PROJECT_DIR = os.path.dirname(__file__)
DEBUG = True
-TEMPLATE_DEBUG = DEBUG
-ADMINS = ( )
+ADMINS = ()
MANAGERS = ADMINS
@@ -21,6 +21,8 @@ DATABASES = {
}
}
+DATABASE_ROUTERS = ['nop.dbrouter.NopRouter']
+
TIME_ZONE = 'Europe/Vienna'
LANGUAGE_CODE = 'de'
@@ -30,20 +32,38 @@ SITE_ID = 1
USE_I18N = True
USE_L10N = True
-LOCALE_PATHS = os.path.join(PROJECT_DIR, 'locale')
+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 = ''
-TEMPLATE_LOADERS = (
- 'django.template.loaders.filesystem.Loader',
- 'django.template.loaders.app_directories.Loader',
-# 'django.template.loaders.eggs.Loader',
-)
+TEMPLATES = [
+ {
+ 'BACKEND': 'django.template.backends.django.DjangoTemplates',
+ 'DIRS': [
+ os.path.join(PROJECT_DIR, 'templates')
+ ],
+ 'APP_DIRS': True,
+ 'OPTIONS': {
+ 'context_processors': [
+ 'django.contrib.auth.context_processors.auth',
+ 'django.template.context_processors.debug',
+ 'django.template.context_processors.i18n',
+ 'django.template.context_processors.media',
+ 'django.template.context_processors.static',
+ 'django.template.context_processors.tz',
+ 'django.contrib.messages.context_processors.messages',
+ ],
+ },
+ },
+]
MIDDLEWARE_CLASSES = (
'django.middleware.common.CommonMiddleware',
@@ -55,10 +75,6 @@ MIDDLEWARE_CLASSES = (
ROOT_URLCONF = 'pv.urls'
-TEMPLATE_DIRS = (
- os.path.join(PROJECT_DIR, "templates"),
-)
-
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
@@ -74,7 +90,7 @@ INSTALLED_APPS = (
TINYMCE_JS_URL = '/static/js/tiny_mce/tiny_mce.js'
TINYMCE_DEFAULT_CONFIG = {
- 'plugins' : 'contextmenu',
+ 'plugins': 'contextmenu',
'theme': 'advanced',
'theme_advanced_toolbar_location': 'top',
}
diff --git a/pv/urls.py b/pv/urls.py
index e55dddc..ec1cdff 100644
--- a/pv/urls.py
+++ b/pv/urls.py
@@ -1,19 +1,20 @@
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()
from program.views import json_day_schedule
+
urlpatterns = patterns('',
- (r'^admin/', include(admin.site.urls)),
- (r'^program/', include('program.urls')),
- (r'^nop', include('nop.urls')),
- (r'^tinymce/', include('tinymce.urls')),
- url(r'^export/day_schedule/(?P<year>\d{4})/(?P<month>\d{1,2})/(?P<day>\d{1,2})/$', json_day_schedule),
+ url(r'^admin/', include(admin.site.urls)),
+ url(r'^program/', include('program.urls')),
+ url(r'^nop', include('nop.urls')),
+ url(r'^tinymce/', include('tinymce.urls')),
+ url(r'^export/day_schedule/(?P<year>\d{4})/(?P<month>\d{1,2})/(?P<day>\d{1,2})/$', json_day_schedule)
)
if settings.DEBUG:
urlpatterns += patterns('',
- (r'^site_media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT})
- )
+ (r'^site_media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT})
+)
diff --git a/pv/wsgi.py b/pv/wsgi.py
index 2ba7fe3..f704d30 100644
--- a/pv/wsgi.py
+++ b/pv/wsgi.py
@@ -13,9 +13,10 @@ middleware here, or combine a Django application with an application of another
framework.
"""
-import os, sys
+import os
+import sys
-sys.path.append('/var/www/pv')
+sys.path.append('/srv/pv/pv')
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "pv.settings")