Fix im settings.
[pithos] / pithos / settings.py.dist
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 modules to use and their initilization options.
62
63 # SQLite.
64 #BACKEND_DB_MODULE = 'pithos.backends.lib.sqlite'
65 #BACKEND_DB_CONNECTION = os.path.join(PROJECT_PATH, 'backend.db')
66
67 # SQLAlchemy (choose SQLite/MySQL/PostgreSQL).
68 BACKEND_DB_MODULE = 'pithos.backends.lib.sqlalchemy'
69 BACKEND_DB_CONNECTION = 'sqlite:///' + os.path.join(PROJECT_PATH, 'backend.db')
70 #BACKEND_DB_CONNECTION = 'mysql://user:pass@host/db'
71 #BACKEND_DB_CONNECTION = 'postgresql://user:pass@host/db'
72
73 # Block storage.
74 BACKEND_BLOCK_MODULE = 'pithos.backends.lib.hashfiler'
75 BACKEND_BLOCK_PATH = os.path.join(PROJECT_PATH, 'data/')
76
77
78 # Bypass authentication for user administration.
79 BYPASS_ADMIN_AUTH = False
80
81 # Local time zone for this installation. Choices can be found here:
82 # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
83 # although not all choices may be available on all operating systems.
84 # On Unix systems, a value of None will cause Django to use the same
85 # timezone as the operating system.
86 # If running in a Windows environment this must be set to the same as your
87 # system time zone.
88 TIME_ZONE = 'UTC'
89
90 # Language code for this installation. All choices can be found here:
91 # http://www.i18nguy.com/unicode/language-identifiers.html
92 LANGUAGE_CODE = 'en-us'
93
94 SITE_ID = 1
95
96 # If you set this to False, Django will make some optimizations so as not
97 # to load the internationalization machinery.
98 USE_I18N = True
99
100 # If you set this to False, Django will not format dates, numbers and
101 # calendars according to the current locale
102 USE_L10N = True
103
104 # Absolute filesystem path to the directory that will hold user-uploaded files.
105 # Example: "/home/media/media.lawrence.com/"
106 MEDIA_ROOT = ''
107
108 # URL that handles the media served from MEDIA_ROOT. Make sure to use a
109 # trailing slash if there is a path component (optional in other cases).
110 # Examples: "http://media.lawrence.com", "http://example.com/media/"
111 MEDIA_URL = ''
112
113 # URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
114 # trailing slash.
115 # Examples: "http://foo.com/media/", "/media/".
116 ADMIN_MEDIA_PREFIX = '/media/'
117
118 # Make this unique, and don't share it with anybody.
119 SECRET_KEY = '$j0cdrfm*0sc2j+e@@2f-&3-_@2=^!z#+b-8o4_i10@2%ev7si'
120
121 # List of callables that know how to import templates from various sources.
122 TEMPLATE_LOADERS = (
123     'django.template.loaders.filesystem.Loader',
124     'django.template.loaders.app_directories.Loader',
125 #     'django.template.loaders.eggs.Loader',
126 )
127
128 MIDDLEWARE_CLASSES = (
129     'django.middleware.common.CommonMiddleware',
130 #    'django.contrib.sessions.middleware.SessionMiddleware',
131 #    'django.middleware.csrf.CsrfViewMiddleware',
132 #    'django.contrib.auth.middleware.AuthenticationMiddleware',
133 #    'django.contrib.messages.middleware.MessageMiddleware',
134     'pithos.middleware.LoggingConfigMiddleware',
135     'pithos.middleware.AuthMiddleware'
136 )
137
138 ROOT_URLCONF = 'pithos.urls'
139
140 TEMPLATE_DIRS = (
141     # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
142     # Always use forward slashes, even on Windows.
143     # Don't forget to use absolute paths, not relative paths.
144 )
145
146 INSTALLED_APPS = (
147 #    'django.contrib.auth',
148 #    'django.contrib.contenttypes',
149 #    'django.contrib.sessions',
150 #    'django.contrib.sites',
151 #    'django.contrib.messages',
152 #    'django.contrib.admin',
153 #    'django.contrib.admindocs',
154     'pithos.im',
155     'pithos.api',
156     'pithos.public',
157     'pithos.ui'
158 )
159
160 # Set the expiration time of newly created auth tokens
161 # to be this many hours after their creation time.
162 AUTH_TOKEN_DURATION = 30 * 24
163
164 # Default setting for new accounts.
165 DEFAULT_QUOTA = 50 * 1024 * 1024 * 1024
166 DEFAULT_VERSIONING = 'auto'
167
168 # Show these many users per page in admin interface.
169 ADMIN_PAGE_LIMIT = 100
170
171 # Authenticate via Twitter.
172 TWITTER_KEY = ''
173 TWITTER_SECRET = ''
174
175 # Address to use for outgoing emails
176 DEFAULT_FROM_EMAIL = 'Pithos <no-reply@grnet.gr>'
177 DEFAULT_CONTACT_EMAIL = 'support@pithos.grnet.gr'
178
179 FEEDBACK_FROM_EMAIL = DEFAULT_FROM_EMAIL
180 FEEDBACK_CONTACT_EMAIL = DEFAULT_CONTACT_EMAIL
181
182 INVITATIONS_PER_LEVEL = {
183     0   :   100,
184     1   :   2,
185     2   :   0,
186     3   :   0,
187     4   :   0
188 }
189
190 BASE_URL = 'http://plus.pithos.grnet.gr'
191 SERVICE_NAME = 'Pithos+'
192
193 # Where users should login with their invitation code
194 INVITATION_LOGIN_TARGET = BASE_URL + 'im/login/invitation' \
195                             '?code=%d' \
196                             '&next=' + BASE_URL + 'ui'
197
198 # Where users should activate their local account
199 ACTIVATION_LOGIN_TARGET = BASE_URL + 'im/login/local/activate/' \
200                             '?auth=%s' \
201                             '&next=' + BASE_URL + 'im/login'
202
203 # Where users should reset their local password
204 PASSWORD_RESET_TARGET = BASE_URL + 'im/login/local/reset/' \
205                             '?auth=%s' \
206                             '&next=' + BASE_URL + 'im/login?next=' + BASE_URL + 'ui'
207
208 # The server is behind a proy (apache and gunicorn setup).
209 USE_X_FORWARDED_HOST = False
210
211 # Use to log to a file.
212 LOGFILE = None