/src/danseku/settings.py
Python | 133 lines | 120 code | 10 blank | 3 comment | 1 complexity | 5c203e3904bb913a9eb54c8dc0e0e52b MD5 | raw file
Possible License(s): BSD-3-Clause
1# Django settings for danseku project.
2
3import os.path
4
5DEBUG = True
6TEMPLATE_DEBUG = DEBUG
7
8ADMINS = (
9 ('Jonas Myrlund', 'myrlund@gmail.com'),
10)
11
12MANAGERS = ADMINS
13
14DATABASE_ENGINE = 'sqlite3' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
15DATABASE_NAME = os.path.join(os.path.dirname(__file__), 'danseku.db').replace('\\','/') # Or path to database file if using sqlite3.
16DATABASE_USER = 'danseku2' # Not used with sqlite3.
17DATABASE_PASSWORD = 'eLZqsxHNCGuj2qYS' # Not used with sqlite3.
18DATABASE_HOST = '' # Set to empty string for localhost. Not used with sqlite3.
19DATABASE_PORT = '' # Set to empty string for default. Not used with sqlite3.
20
21make_path = lambda p: os.path.join(os.path.dirname(__file__), p).replace('\\','/')
22PATH_FILES = make_path('files')
23
24make_relpath = lambda p: os.path.join(PATH_FILES, p).replace('\\','/')
25PATH_STATIC = make_relpath('static')
26PATH_RESOURCES = make_relpath('resources')
27
28# Latex-options
29LATEX_URL = "static/latex/"
30LATEX_PATH = make_relpath(LATEX_URL)
31LATEX_URL = "/" + LATEX_URL
32LATEX_PREFIX = "eqn-"
33LATEX_SIZE = 1.3
34
35AUTH_PROFILE_MODULE = "user_profile.userprofile"
36
37MAIN_MENU = [
38 {"title": "Hjem", "url": "/"},
39 {"title": "Nyheter", "url": "/news/"},
40 {"title": "Fagoversikt", "url": "/courses/"},
41]
42
43KEYS = {
44 "new": "ny",
45 "edit": "rediger",
46 "upload": "last_opp",
47 "add_class": "legg_til_klasse",
48 "favorite": "favorize",
49}
50
51LOGIN_URL = "/user/login/"
52
53DATE_FORMAT = "d.m.Y"
54DATETIME_FORMAT = DATE_FORMAT+" H:i"
55
56# Local time zone for this installation. Choices can be found here:
57# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
58# although not all choices may be available on all operating systems.
59# If running in a Windows environment this must be set to the same as your
60# system time zone.
61TIME_ZONE = 'Europe/Oslo'
62
63# Language code for this installation. All choices can be found here:
64# http://www.i18nguy.com/unicode/language-identifiers.html
65LANGUAGE_CODE = 'no-nb'
66
67SITE_ID = 1
68SITE_NAME = "danseku.no"
69
70# If you set this to False, Django will make some optimizations so as not
71# to load the internationalization machinery.
72USE_I18N = True
73
74# Absolute path to the directory that holds media.
75# Example: "/home/media/media.lawrence.com/"
76MEDIA_ROOT = PATH_FILES
77
78# URL that handles the media served from MEDIA_ROOT. Make sure to use a
79# trailing slash if there is a path component (optional in other cases).
80# Examples: "http://media.lawrence.com", "http://example.com/media/"
81MEDIA_URL = ''
82
83# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
84# trailing slash.
85# Examples: "http://foo.com/media/", "/media/".
86ADMIN_MEDIA_PREFIX = '/media/'
87
88# Make this unique, and don't share it with anybody.
89SECRET_KEY = 'nkk5udh1x(qv(tc8c&c%v!okms(394+7&jmbfxq&@arm9!++te'
90
91# List of callables that know how to import templates from various sources.
92TEMPLATE_LOADERS = (
93 'django.template.loaders.filesystem.load_template_source',
94 'django.template.loaders.app_directories.load_template_source',
95# 'django.template.loaders.eggs.load_template_source',
96)
97
98MIDDLEWARE_CLASSES = (
99 'django.middleware.common.CommonMiddleware',
100 'django.middleware.csrf.CsrfViewMiddleware',
101 'django.contrib.sessions.middleware.SessionMiddleware',
102 'django.contrib.auth.middleware.AuthenticationMiddleware',
103)
104
105ROOT_URLCONF = 'danseku.urls'
106
107TEMPLATE_DIRS = (
108 os.path.join(os.path.dirname(__file__), 'templates').replace('\\','/'),
109)
110
111TEMPLATE_CONTEXT_PROCESSORS = (
112 'django.core.context_processors.auth',
113 'django.core.context_processors.debug',
114 'django.core.context_processors.i18n',
115 'django.core.context_processors.media',
116 'django.core.context_processors.request',
117 'danseku.context_processors.get_mainmenu',
118 'danseku.context_processors.generic_settings',
119)
120
121INSTALLED_APPS = (
122 'django.contrib.auth',
123 'django.contrib.contenttypes',
124 'django.contrib.sessions',
125 'django.contrib.sites',
126 'django.contrib.admin',
127 'django.contrib.comments',
128 'django.contrib.markup',
129 'danseku.resources',
130 'danseku.user_profile',
131 'danseku.news',
132 'danseku.core',
133)