~doctormo/erato/trunk

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
#
# Copyright 2010, Martin Owens and Adnane Belmadiaf.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
#

# Django settings for art_website project.

import os, platform
from local_settings import *

PROJECT_PATH = os.path.dirname(os.path.abspath(__file__))
WEBSITE_PATH = os.path.dirname(PROJECT_PATH)

# Far too clever trick to know if we're running on the deployment server.
DEVELOPMENT_MODE = (platform.node() != "art-ubuntu")
if DEVELOPMENT_MODE:
	DEBUG = True
else:
	DEBUG = False

TEMPLATE_DEBUG = DEBUG
STATIC_SERVE = True

ADMINS = (
    ('doctormo', 'doctormo@gmail.com'),
    ('daker', 'adnane002@gmail.com'),
)

MANAGERS = ADMINS

import memcache
MEMORY_CACHE = memcache.Client(MEMCACHE, debug=0)

TIME_ZONE = 'UTC'
LANGUAGE_CODE = 'en-gb'
SITE_ID = 1
USE_I18N = False

# Media handeling
UPLOAD_ROOT = os.path.join(PROJECT_PATH, 'uploads')
MEDIA_ROOT = os.path.join(WEBSITE_PATH, 'media')
MEDIA_URL = '/media/'
ADMIN_MEDIA_PREFIX = '/admin_media/'

# Template handeling
TEMPLATE_LOADERS = (
    'django.template.loaders.filesystem.load_template_source',
    'django.template.loaders.app_directories.load_template_source',
)

MIDDLEWARE_CLASSES = (
    'django.middleware.common.CommonMiddleware',
    'django.middleware.locale.LocaleMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
)

TEMPLATE_CONTEXT_PROCESSORS = (
    "django.core.context_processors.request",
    "django.core.context_processors.auth",
    "django.core.context_processors.debug",
    "django.core.context_processors.i18n",
    "django.core.context_processors.media",
    "common.context_processors.project_version",
    #"common.context_processors.google_api_key",
    #"common.context_processors.flickr_api_key",
    "common.context_processors.login_redirect",
    "common.context_processors.url_base",
    "common.context_processors.site_search",
)

AUTHENTICATION_BACKENDS = (
    "django_openid_auth.auth.OpenIDBackend",
    "django.contrib.auth.backends.ModelBackend",
)

ROOT_URLCONF = 'art_website.urls'

TEMPLATE_DIRS = (
    os.path.join(WEBSITE_PATH, 'templates/'),
)

INSTALLED_APPS = (
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.sites',
    'django.contrib.admin',
    'django_openid_auth',
    'users',
    'creations',
    'assets',
)

AUTH_PROFILE_MODULE = 'users.UserProfile'

OPENID_CREATE_USERS = True
OPENID_UPDATE_DETAILS_FROM_SREG = True
LOGIN_URL = '/openid/login/'
LOGIN_REDIRECT_URL = '/'
OPENID_SSO_SERVER_URL = 'https://login.launchpad.net/'
#OPENID_USE_AS_ADMIN_LOGIN = True

from common import utils
VERSION_STRING = utils.get_bzrdirectory_version( os.path.join(PROJECT_PATH, "version"), DEBUG)

import logging
try:
	from local_settings import *
except ImportError:
	logging.warning("No local_settings.py were found. See INSTALL for instructions.")