Statistics
| Branch: | Tag: | Revision:

root / pithos / settings.py.dist @ 618d7e05

History | View | Annotate | Download (7.3 kB)

1 5635f9ef Antony Chazapis
# Copyright 2011 GRNET S.A. All rights reserved.
2 5635f9ef Antony Chazapis
# 
3 5635f9ef Antony Chazapis
# Redistribution and use in source and binary forms, with or
4 5635f9ef Antony Chazapis
# without modification, are permitted provided that the following
5 5635f9ef Antony Chazapis
# conditions are met:
6 5635f9ef Antony Chazapis
# 
7 5635f9ef Antony Chazapis
#   1. Redistributions of source code must retain the above
8 5635f9ef Antony Chazapis
#      copyright notice, this list of conditions and the following
9 5635f9ef Antony Chazapis
#      disclaimer.
10 5635f9ef Antony Chazapis
# 
11 5635f9ef Antony Chazapis
#   2. Redistributions in binary form must reproduce the above
12 5635f9ef Antony Chazapis
#      copyright notice, this list of conditions and the following
13 5635f9ef Antony Chazapis
#      disclaimer in the documentation and/or other materials
14 5635f9ef Antony Chazapis
#      provided with the distribution.
15 5635f9ef Antony Chazapis
# 
16 5635f9ef Antony Chazapis
# THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS
17 5635f9ef Antony Chazapis
# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 5635f9ef Antony Chazapis
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19 5635f9ef Antony Chazapis
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR
20 5635f9ef Antony Chazapis
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21 5635f9ef Antony Chazapis
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22 5635f9ef Antony Chazapis
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
23 5635f9ef Antony Chazapis
# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
24 5635f9ef Antony Chazapis
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 5635f9ef Antony Chazapis
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
26 5635f9ef Antony Chazapis
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27 5635f9ef Antony Chazapis
# POSSIBILITY OF SUCH DAMAGE.
28 5635f9ef Antony Chazapis
# 
29 5635f9ef Antony Chazapis
# The views and conclusions contained in the software and
30 5635f9ef Antony Chazapis
# documentation are those of the authors and should not be
31 5635f9ef Antony Chazapis
# interpreted as representing official policies, either expressed
32 5635f9ef Antony Chazapis
# or implied, of GRNET S.A.
33 5635f9ef Antony Chazapis
34 b956618e Antony Chazapis
# Django settings for pithos project.
35 b956618e Antony Chazapis
import os
36 b956618e Antony Chazapis
37 b956618e Antony Chazapis
PROJECT_PATH = os.path.dirname(os.path.abspath(__file__)) + '/'
38 b956618e Antony Chazapis
39 b956618e Antony Chazapis
DEBUG = True
40 b956618e Antony Chazapis
TEMPLATE_DEBUG = DEBUG
41 b956618e Antony Chazapis
42 b956618e Antony Chazapis
TEST = False
43 b956618e Antony Chazapis
44 b956618e Antony Chazapis
ADMINS = (
45 b956618e Antony Chazapis
    # ('Your Name', 'your_email@domain.com'),
46 b956618e Antony Chazapis
)
47 b956618e Antony Chazapis
48 b956618e Antony Chazapis
MANAGERS = ADMINS
49 b956618e Antony Chazapis
50 b956618e Antony Chazapis
DATABASES = {
51 b956618e Antony Chazapis
    'default': {
52 10283860 Sofia Papagiannaki
        'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
53 b956618e Antony Chazapis
        'NAME': PROJECT_PATH + 'pithos.db',		# Or path to database file if using sqlite3.
54 b956618e Antony Chazapis
        'USER': '',                      # Not used with sqlite3.
55 b956618e Antony Chazapis
        'PASSWORD': '',                  # Not used with sqlite3.
56 b956618e Antony Chazapis
        'HOST': '',                      # Set to empty string for localhost. Not used with sqlite3.
57 b956618e Antony Chazapis
        'PORT': '',                      # Set to empty string for default. Not used with sqlite3.
58 b956618e Antony Chazapis
    }
59 b956618e Antony Chazapis
}
60 b956618e Antony Chazapis
61 e9363f82 Antony Chazapis
# The backend modules to use and their initilization options.
62 e9363f82 Antony Chazapis
63 e9363f82 Antony Chazapis
# SQLite.
64 e9363f82 Antony Chazapis
#BACKEND_DB_MODULE = 'pithos.backends.lib.sqlite'
65 e9363f82 Antony Chazapis
#BACKEND_DB_CONNECTION = os.path.join(PROJECT_PATH, 'backend.db')
66 e9363f82 Antony Chazapis
67 e9363f82 Antony Chazapis
# SQLAlchemy (choose SQLite/MySQL/PostgreSQL).
68 e9363f82 Antony Chazapis
BACKEND_DB_MODULE = 'pithos.backends.lib.sqlalchemy'
69 e9363f82 Antony Chazapis
BACKEND_DB_CONNECTION = 'sqlite:///' + os.path.join(PROJECT_PATH, 'backend.db')
70 e9363f82 Antony Chazapis
#BACKEND_DB_CONNECTION = 'mysql://user:pass@host/db'
71 e9363f82 Antony Chazapis
#BACKEND_DB_CONNECTION = 'postgresql://user:pass@host/db'
72 e9363f82 Antony Chazapis
73 e9363f82 Antony Chazapis
# Block storage.
74 e9363f82 Antony Chazapis
BACKEND_BLOCK_MODULE = 'pithos.backends.lib.hashfiler'
75 e9363f82 Antony Chazapis
BACKEND_BLOCK_PATH = os.path.join(PROJECT_PATH, 'data/')
76 2c5363a0 Antony Chazapis
77 552ea518 Antony Chazapis
# Bypass authentication for user administration.
78 b8f6710f Giorgos Verigakis
BYPASS_ADMIN_AUTH = False
79 b8f6710f Giorgos Verigakis
80 b956618e Antony Chazapis
# Local time zone for this installation. Choices can be found here:
81 b956618e Antony Chazapis
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
82 b956618e Antony Chazapis
# although not all choices may be available on all operating systems.
83 b956618e Antony Chazapis
# On Unix systems, a value of None will cause Django to use the same
84 b956618e Antony Chazapis
# timezone as the operating system.
85 b956618e Antony Chazapis
# If running in a Windows environment this must be set to the same as your
86 b956618e Antony Chazapis
# system time zone.
87 b956618e Antony Chazapis
TIME_ZONE = 'UTC'
88 b956618e Antony Chazapis
89 b956618e Antony Chazapis
# Language code for this installation. All choices can be found here:
90 b956618e Antony Chazapis
# http://www.i18nguy.com/unicode/language-identifiers.html
91 b956618e Antony Chazapis
LANGUAGE_CODE = 'en-us'
92 b956618e Antony Chazapis
93 b956618e Antony Chazapis
SITE_ID = 1
94 b956618e Antony Chazapis
95 b956618e Antony Chazapis
# If you set this to False, Django will make some optimizations so as not
96 b956618e Antony Chazapis
# to load the internationalization machinery.
97 b956618e Antony Chazapis
USE_I18N = True
98 b956618e Antony Chazapis
99 b956618e Antony Chazapis
# If you set this to False, Django will not format dates, numbers and
100 b956618e Antony Chazapis
# calendars according to the current locale
101 b956618e Antony Chazapis
USE_L10N = True
102 b956618e Antony Chazapis
103 b956618e Antony Chazapis
# Absolute filesystem path to the directory that will hold user-uploaded files.
104 b956618e Antony Chazapis
# Example: "/home/media/media.lawrence.com/"
105 b956618e Antony Chazapis
MEDIA_ROOT = ''
106 b956618e Antony Chazapis
107 b956618e Antony Chazapis
# URL that handles the media served from MEDIA_ROOT. Make sure to use a
108 b956618e Antony Chazapis
# trailing slash if there is a path component (optional in other cases).
109 b956618e Antony Chazapis
# Examples: "http://media.lawrence.com", "http://example.com/media/"
110 b956618e Antony Chazapis
MEDIA_URL = ''
111 b956618e Antony Chazapis
112 b956618e Antony Chazapis
# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
113 b956618e Antony Chazapis
# trailing slash.
114 b956618e Antony Chazapis
# Examples: "http://foo.com/media/", "/media/".
115 b956618e Antony Chazapis
ADMIN_MEDIA_PREFIX = '/media/'
116 b956618e Antony Chazapis
117 b956618e Antony Chazapis
# Make this unique, and don't share it with anybody.
118 b956618e Antony Chazapis
SECRET_KEY = '$j0cdrfm*0sc2j+e@@2f-&3-_@2=^!z#+b-8o4_i10@2%ev7si'
119 b956618e Antony Chazapis
120 b956618e Antony Chazapis
# List of callables that know how to import templates from various sources.
121 b956618e Antony Chazapis
TEMPLATE_LOADERS = (
122 b956618e Antony Chazapis
    'django.template.loaders.filesystem.Loader',
123 b956618e Antony Chazapis
    'django.template.loaders.app_directories.Loader',
124 b956618e Antony Chazapis
#     'django.template.loaders.eggs.Loader',
125 b956618e Antony Chazapis
)
126 b956618e Antony Chazapis
127 b956618e Antony Chazapis
MIDDLEWARE_CLASSES = (
128 b956618e Antony Chazapis
    'django.middleware.common.CommonMiddleware',
129 d7d60147 Antony Chazapis
#    'django.contrib.sessions.middleware.SessionMiddleware',
130 b956618e Antony Chazapis
#    'django.middleware.csrf.CsrfViewMiddleware',
131 d7d60147 Antony Chazapis
#    'django.contrib.auth.middleware.AuthenticationMiddleware',
132 d7d60147 Antony Chazapis
#    'django.contrib.messages.middleware.MessageMiddleware',
133 618d7e05 Sofia Papagiannaki
    'pithos.middleware.URLEncodedHeadersMiddleware',
134 aa4fac11 Giorgos Verigakis
    'pithos.middleware.LoggingConfigMiddleware',
135 d7d60147 Antony Chazapis
    'pithos.middleware.AuthMiddleware'
136 b956618e Antony Chazapis
)
137 b956618e Antony Chazapis
138 b956618e Antony Chazapis
ROOT_URLCONF = 'pithos.urls'
139 b956618e Antony Chazapis
140 b956618e Antony Chazapis
TEMPLATE_DIRS = (
141 b956618e Antony Chazapis
    # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
142 b956618e Antony Chazapis
    # Always use forward slashes, even on Windows.
143 b956618e Antony Chazapis
    # Don't forget to use absolute paths, not relative paths.
144 b956618e Antony Chazapis
)
145 b956618e Antony Chazapis
146 b956618e Antony Chazapis
INSTALLED_APPS = (
147 d7d60147 Antony Chazapis
#    'django.contrib.auth',
148 d7d60147 Antony Chazapis
#    'django.contrib.contenttypes',
149 d7d60147 Antony Chazapis
#    'django.contrib.sessions',
150 d7d60147 Antony Chazapis
#    'django.contrib.sites',
151 d7d60147 Antony Chazapis
#    'django.contrib.messages',
152 b956618e Antony Chazapis
#    'django.contrib.admin',
153 b956618e Antony Chazapis
#    'django.contrib.admindocs',
154 7e392d16 Antony Chazapis
    'pithos.im',
155 502687d0 Antony Chazapis
    'pithos.api',
156 618d7e05 Sofia Papagiannaki
    'pithos.ui',
157 618d7e05 Sofia Papagiannaki
    'south'
158 b956618e Antony Chazapis
)
159 aa4fac11 Giorgos Verigakis
160 d7d60147 Antony Chazapis
# Set the expiration time of newly created auth tokens
161 d7d60147 Antony Chazapis
# to be this many hours after their creation time.
162 d7d60147 Antony Chazapis
AUTH_TOKEN_DURATION = 30 * 24
163 d7d60147 Antony Chazapis
164 b2832c6a Antony Chazapis
# Default setting for new accounts.
165 b2832c6a Antony Chazapis
DEFAULT_QUOTA = 50 * 1024 * 1024 * 1024
166 b2832c6a Antony Chazapis
DEFAULT_VERSIONING = 'auto'
167 393196a8 Giorgos Verigakis
168 b6b41731 Antony Chazapis
# Show these many users per page in admin interface.
169 65114032 Giorgos Verigakis
ADMIN_PAGE_LIMIT = 100
170 1a7c659b Antony Chazapis
171 1a7c659b Antony Chazapis
# Authenticate via Twitter.
172 9fd41dd3 Sofia Papagiannaki
TWITTER_KEY = ''
173 9fd41dd3 Sofia Papagiannaki
TWITTER_SECRET = ''
174 93f046ab Giorgos Verigakis
175 93f046ab Giorgos Verigakis
# Address to use for outgoing emails
176 93f046ab Giorgos Verigakis
DEFAULT_FROM_EMAIL = 'Pithos <no-reply@grnet.gr>'
177 29ab141c Antony Chazapis
DEFAULT_CONTACT_EMAIL = 'support@pithos.grnet.gr'
178 29ab141c Antony Chazapis
179 1a91f0de Giorgos Verigakis
FEEDBACK_FROM_EMAIL = DEFAULT_FROM_EMAIL
180 29ab141c Antony Chazapis
FEEDBACK_CONTACT_EMAIL = DEFAULT_CONTACT_EMAIL
181 93f046ab Giorgos Verigakis
182 390c4b88 Giorgos Verigakis
INVITATIONS_PER_LEVEL = {
183 ab5c2b55 Antony Chazapis
    0   :   100,
184 ab5c2b55 Antony Chazapis
    1   :   2,
185 390c4b88 Giorgos Verigakis
    2   :   0,
186 390c4b88 Giorgos Verigakis
    3   :   0,
187 390c4b88 Giorgos Verigakis
    4   :   0
188 390c4b88 Giorgos Verigakis
}
189 390c4b88 Giorgos Verigakis
190 618d7e05 Sofia Papagiannaki
SERVICE_NAME = 'Pithos'
191 bee5ffa6 Sofia Papagiannaki
192 93f046ab Giorgos Verigakis
# Where users should login with their invitation code
193 618d7e05 Sofia Papagiannaki
INVITATION_LOGIN_TARGET = '%s/im/login/invitation' \
194 93f046ab Giorgos Verigakis
                            '?code=%d' \
195 a7ae042e Sofia Papagiannaki
                            '&next=%s'
196 ee1a7617 Antony Chazapis
197 bee5ffa6 Sofia Papagiannaki
# Where users should activate their local account
198 618d7e05 Sofia Papagiannaki
ACTIVATION_LOGIN_TARGET = '%s/im/local/activate/' \
199 bee5ffa6 Sofia Papagiannaki
                            '?auth=%s' \
200 a7ae042e Sofia Papagiannaki
                            '&next=%s'
201 bee5ffa6 Sofia Papagiannaki
202 bee5ffa6 Sofia Papagiannaki
# Where users should reset their local password
203 618d7e05 Sofia Papagiannaki
PASSWORD_RESET_TARGET = '%s/im/local/reset/' \
204 a7ae042e Sofia Papagiannaki
                            '?username=%s' \
205 a7ae042e Sofia Papagiannaki
                            '&next=%s'
206 bee5ffa6 Sofia Papagiannaki
207 618d7e05 Sofia Papagiannaki
# Force user profile verification
208 618d7e05 Sofia Papagiannaki
FORCE_PROFILE_UPDATE = False
209 618d7e05 Sofia Papagiannaki
210 4048f62c Antony Chazapis
# The server is behind a proy (apache and gunicorn setup).
211 4048f62c Antony Chazapis
USE_X_FORWARDED_HOST = False
212 4048f62c Antony Chazapis
213 618d7e05 Sofia Papagiannaki
# Set umask (needed for gunicorn setup).
214 618d7e05 Sofia Papagiannaki
#os.umask(0077)
215 618d7e05 Sofia Papagiannaki
216 ee1a7617 Antony Chazapis
# Use to log to a file.
217 ee1a7617 Antony Chazapis
LOGFILE = None
218 618d7e05 Sofia Papagiannaki
219 618d7e05 Sofia Papagiannaki
# Identity Management enabled modules
220 618d7e05 Sofia Papagiannaki
IM_STANDARD_MODULES = ['local', 'invitation']
221 618d7e05 Sofia Papagiannaki
IM_OTHER_MODULES = ['twitter', 'shibboleth']