Statistics
| Branch: | Tag: | Revision:

root / pithos / settings.py.dist @ 4048f62c

History | View | Annotate | Download (6.5 kB)

1
# Copyright 2011 GRNET S.A. All rights reserved.
2
# 
3
# Redistribution and use in source and binary forms, with or
4
# without modification, are permitted provided that the following
5
# conditions are met:
6
# 
7
#   1. Redistributions of source code must retain the above
8
#      copyright notice, this list of conditions and the following
9
#      disclaimer.
10
# 
11
#   2. Redistributions in binary form must reproduce the above
12
#      copyright notice, this list of conditions and the following
13
#      disclaimer in the documentation and/or other materials
14
#      provided with the distribution.
15
# 
16
# THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS
17
# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR
20
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
23
# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
24
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
26
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27
# POSSIBILITY OF SUCH DAMAGE.
28
# 
29
# The views and conclusions contained in the software and
30
# documentation are those of the authors and should not be
31
# interpreted as representing official policies, either expressed
32
# or implied, of GRNET S.A.
33

    
34
# Django settings for pithos project.
35
import os
36

    
37
PROJECT_PATH = os.path.dirname(os.path.abspath(__file__)) + '/'
38

    
39
DEBUG = True
40
TEMPLATE_DEBUG = DEBUG
41

    
42
TEST = False
43

    
44
ADMINS = (
45
    # ('Your Name', 'your_email@domain.com'),
46
)
47

    
48
MANAGERS = ADMINS
49

    
50
DATABASES = {
51
    'default': {
52
        'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
53
        'NAME': PROJECT_PATH + 'pithos.db',		# Or path to database file if using sqlite3.
54
        'USER': '',                      # Not used with sqlite3.
55
        'PASSWORD': '',                  # Not used with sqlite3.
56
        'HOST': '',                      # Set to empty string for localhost. Not used with sqlite3.
57
        'PORT': '',                      # Set to empty string for default. Not used with sqlite3.
58
    }
59
}
60

    
61
# The backend to use and its initilization options.
62

    
63
# Modular.
64
backend_module = 'pithos.backends.lib.sqlite'
65
backend_path = os.path.join(PROJECT_PATH, 'data/pithos/')
66
backend_db = os.path.join(PROJECT_PATH, 'data/pithos/db')
67
#backend_module = 'pithos.backends.lib.sqlalchemy'
68
#backend_path = os.path.join(PROJECT_PATH, 'data/pithos/')
69
#backend_db = 'postgresql://user:pass@host/db'
70
BACKEND = ('ModularBackend', (backend_module, backend_path, backend_db))
71

    
72
# Bypass authentication for user administration.
73
BYPASS_ADMIN_AUTH = False
74

    
75
# Local time zone for this installation. Choices can be found here:
76
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
77
# although not all choices may be available on all operating systems.
78
# On Unix systems, a value of None will cause Django to use the same
79
# timezone as the operating system.
80
# If running in a Windows environment this must be set to the same as your
81
# system time zone.
82
TIME_ZONE = 'UTC'
83

    
84
# Language code for this installation. All choices can be found here:
85
# http://www.i18nguy.com/unicode/language-identifiers.html
86
LANGUAGE_CODE = 'en-us'
87

    
88
SITE_ID = 1
89

    
90
# If you set this to False, Django will make some optimizations so as not
91
# to load the internationalization machinery.
92
USE_I18N = True
93

    
94
# If you set this to False, Django will not format dates, numbers and
95
# calendars according to the current locale
96
USE_L10N = True
97

    
98
# Absolute filesystem path to the directory that will hold user-uploaded files.
99
# Example: "/home/media/media.lawrence.com/"
100
MEDIA_ROOT = ''
101

    
102
# URL that handles the media served from MEDIA_ROOT. Make sure to use a
103
# trailing slash if there is a path component (optional in other cases).
104
# Examples: "http://media.lawrence.com", "http://example.com/media/"
105
MEDIA_URL = ''
106

    
107
# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
108
# trailing slash.
109
# Examples: "http://foo.com/media/", "/media/".
110
ADMIN_MEDIA_PREFIX = '/media/'
111

    
112
# Make this unique, and don't share it with anybody.
113
SECRET_KEY = '$j0cdrfm*0sc2j+e@@2f-&3-_@2=^!z#+b-8o4_i10@2%ev7si'
114

    
115
# List of callables that know how to import templates from various sources.
116
TEMPLATE_LOADERS = (
117
    'django.template.loaders.filesystem.Loader',
118
    'django.template.loaders.app_directories.Loader',
119
#     'django.template.loaders.eggs.Loader',
120
)
121

    
122
MIDDLEWARE_CLASSES = (
123
    'django.middleware.common.CommonMiddleware',
124
#    'django.contrib.sessions.middleware.SessionMiddleware',
125
#    'django.middleware.csrf.CsrfViewMiddleware',
126
#    'django.contrib.auth.middleware.AuthenticationMiddleware',
127
#    'django.contrib.messages.middleware.MessageMiddleware',
128
    'pithos.middleware.LoggingConfigMiddleware',
129
    'pithos.middleware.AuthMiddleware'
130
)
131

    
132
ROOT_URLCONF = 'pithos.urls'
133

    
134
TEMPLATE_DIRS = (
135
    # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
136
    # Always use forward slashes, even on Windows.
137
    # Don't forget to use absolute paths, not relative paths.
138
)
139

    
140
INSTALLED_APPS = (
141
#    'django.contrib.auth',
142
#    'django.contrib.contenttypes',
143
#    'django.contrib.sessions',
144
#    'django.contrib.sites',
145
#    'django.contrib.messages',
146
#    'django.contrib.admin',
147
#    'django.contrib.admindocs',
148
    'pithos.im',
149
    'pithos.api',
150
    'pithos.public',
151
    'pithos.ui'
152
)
153

    
154
# Set the expiration time of newly created auth tokens
155
# to be this many hours after their creation time.
156
AUTH_TOKEN_DURATION = 30 * 24
157

    
158
# Default setting for new accounts.
159
DEFAULT_QUOTA = 50 * 1024 * 1024 * 1024
160
DEFAULT_VERSIONING = 'auto'
161

    
162
# Show these many users per page in admin interface.
163
ADMIN_PAGE_LIMIT = 100
164

    
165
# Authenticate via Twitter.
166
TWITTER_KEY = ''
167
TWITTER_SECRET = ''
168

    
169
# Address to use for outgoing emails
170
DEFAULT_FROM_EMAIL = 'Pithos <no-reply@grnet.gr>'
171
FEEDBACK_FROM_EMAIL = DEFAULT_FROM_EMAIL
172
FEEDBACK_CONTACT_EMAIL = 'support@pithos.grnet.gr'
173

    
174
INVITATIONS_PER_LEVEL = {
175
    0   :   100,
176
    1   :   2,
177
    2   :   0,
178
    3   :   0,
179
    4   :   0
180
}
181

    
182
# Where users should login with their invitation code
183
INVITATION_LOGIN_TARGET = 'https://pithos.dev.grnet.gr/im/login/invitation' \
184
                            '?code=%d' \
185
                            '&next=https://pithos.dev.grnet.gr/ui'
186

    
187
# The server is behind a proy (apache and gunicorn setup).
188
USE_X_FORWARDED_HOST = False
189

    
190
# Use to log to a file.
191
LOGFILE = None