X-Git-Url: https://code.grnet.gr/git/pithos/blobdiff_plain/49ae4a555b56ee8c93ecfdc3de6efd2d3b640a57..bee5ffa6f73770e97579db6bbc4b25641c83841a:/pithos/settings.py.dist diff --git a/pithos/settings.py.dist b/pithos/settings.py.dist index 51fc258..df3c426 100644 --- a/pithos/settings.py.dist +++ b/pithos/settings.py.dist @@ -1,107 +1,208 @@ -# Django settings for pithos project. -import os - -PROJECT_PATH = os.path.dirname(os.path.abspath(__file__)) + '/' - -DEBUG = True -TEMPLATE_DEBUG = DEBUG - -# A quick-n-dirty way to know if we're running unit tests -import sys -TEST = False -if len(sys.argv) >= 2: - if os.path.basename(sys.argv[0]) == 'manage.py' and \ - (sys.argv[1] == 'test' or sys.argv[1] == 'hudson'): - TEST = True - -ADMINS = ( - # ('Your Name', 'your_email@domain.com'), -) - -MANAGERS = ADMINS - -DATABASES = { - 'default': { - 'ENGINE': 'sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. - 'NAME': PROJECT_PATH + 'pithos.db', # Or path to database file if using sqlite3. - 'USER': '', # Not used with sqlite3. - 'PASSWORD': '', # Not used with sqlite3. - 'HOST': '', # Set to empty string for localhost. Not used with sqlite3. - 'PORT': '', # Set to empty string for default. Not used with sqlite3. - } -} - -# Local time zone for this installation. Choices can be found here: -# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name -# although not all choices may be available on all operating systems. -# On Unix systems, a value of None will cause Django to use the same -# timezone as the operating system. -# If running in a Windows environment this must be set to the same as your -# system time zone. -TIME_ZONE = 'UTC' - -# Language code for this installation. All choices can be found here: -# http://www.i18nguy.com/unicode/language-identifiers.html -LANGUAGE_CODE = 'en-us' - -SITE_ID = 1 - -# If you set this to False, Django will make some optimizations so as not -# to load the internationalization machinery. -USE_I18N = True - -# If you set this to False, Django will not format dates, numbers and -# calendars according to the current locale -USE_L10N = True - -# Absolute filesystem path to the directory that will hold user-uploaded files. -# Example: "/home/media/media.lawrence.com/" -MEDIA_ROOT = '' - -# URL that handles the media served from MEDIA_ROOT. Make sure to use a -# trailing slash if there is a path component (optional in other cases). -# Examples: "http://media.lawrence.com", "http://example.com/media/" -MEDIA_URL = '' - -# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a -# trailing slash. -# Examples: "http://foo.com/media/", "/media/". -ADMIN_MEDIA_PREFIX = '/media/' - -# Make this unique, and don't share it with anybody. -SECRET_KEY = '$j0cdrfm*0sc2j+e@@2f-&3-_@2=^!z#+b-8o4_i10@2%ev7si' - -# List of callables that know how to import templates from various sources. -TEMPLATE_LOADERS = ( - 'django.template.loaders.filesystem.Loader', - 'django.template.loaders.app_directories.Loader', -# 'django.template.loaders.eggs.Loader', -) - -MIDDLEWARE_CLASSES = ( - 'django.middleware.common.CommonMiddleware', - 'django.contrib.sessions.middleware.SessionMiddleware', -# 'django.middleware.csrf.CsrfViewMiddleware', - 'django.contrib.auth.middleware.AuthenticationMiddleware', - 'django.contrib.messages.middleware.MessageMiddleware', - 'pithos.middleware.LoggingConfigMiddleware' -) - -ROOT_URLCONF = 'pithos.urls' - -TEMPLATE_DIRS = ( - # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates". - # Always use forward slashes, even on Windows. - # Don't forget to use absolute paths, not relative paths. -) - -INSTALLED_APPS = ( - 'django.contrib.auth', - 'django.contrib.contenttypes', - 'django.contrib.sessions', - 'django.contrib.sites', - 'django.contrib.messages', -# 'django.contrib.admin', -# 'django.contrib.admindocs', - 'api' -) +# Copyright 2011 GRNET S.A. All rights reserved. +# +# Redistribution and use in source and binary forms, with or +# without modification, are permitted provided that the following +# conditions are met: +# +# 1. Redistributions of source code must retain the above +# copyright notice, this list of conditions and the following +# disclaimer. +# +# 2. Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following +# disclaimer in the documentation and/or other materials +# provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS +# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# +# The views and conclusions contained in the software and +# documentation are those of the authors and should not be +# interpreted as representing official policies, either expressed +# or implied, of GRNET S.A. + +# Django settings for pithos project. +import os + +PROJECT_PATH = os.path.dirname(os.path.abspath(__file__)) + '/' + +DEBUG = True +TEMPLATE_DEBUG = DEBUG + +TEST = False + +ADMINS = ( + # ('Your Name', 'your_email@domain.com'), +) + +MANAGERS = ADMINS + +DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. + 'NAME': PROJECT_PATH + 'pithos.db', # Or path to database file if using sqlite3. + 'USER': '', # Not used with sqlite3. + 'PASSWORD': '', # Not used with sqlite3. + 'HOST': '', # Set to empty string for localhost. Not used with sqlite3. + 'PORT': '', # Set to empty string for default. Not used with sqlite3. + } +} + +# The backend to use and its initilization options. + +# Modular. +backend_module = 'pithos.backends.lib.sqlite' +backend_path = os.path.join(PROJECT_PATH, 'data/pithos/') +backend_db = os.path.join(PROJECT_PATH, 'data/pithos/db') +#backend_module = 'pithos.backends.lib.sqlalchemy' +#backend_path = os.path.join(PROJECT_PATH, 'data/pithos/') +#backend_db = 'postgresql://user:pass@host/db' +BACKEND = ('ModularBackend', (backend_module, backend_path, backend_db)) + +# Bypass authentication for user administration. +BYPASS_ADMIN_AUTH = False + +# Local time zone for this installation. Choices can be found here: +# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name +# although not all choices may be available on all operating systems. +# On Unix systems, a value of None will cause Django to use the same +# timezone as the operating system. +# If running in a Windows environment this must be set to the same as your +# system time zone. +TIME_ZONE = 'UTC' + +# Language code for this installation. All choices can be found here: +# http://www.i18nguy.com/unicode/language-identifiers.html +LANGUAGE_CODE = 'en-us' + +SITE_ID = 1 + +# If you set this to False, Django will make some optimizations so as not +# to load the internationalization machinery. +USE_I18N = True + +# If you set this to False, Django will not format dates, numbers and +# calendars according to the current locale +USE_L10N = True + +# Absolute filesystem path to the directory that will hold user-uploaded files. +# Example: "/home/media/media.lawrence.com/" +MEDIA_ROOT = '' + +# URL that handles the media served from MEDIA_ROOT. Make sure to use a +# trailing slash if there is a path component (optional in other cases). +# Examples: "http://media.lawrence.com", "http://example.com/media/" +MEDIA_URL = '' + +# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a +# trailing slash. +# Examples: "http://foo.com/media/", "/media/". +ADMIN_MEDIA_PREFIX = '/media/' + +# Make this unique, and don't share it with anybody. +SECRET_KEY = '$j0cdrfm*0sc2j+e@@2f-&3-_@2=^!z#+b-8o4_i10@2%ev7si' + +# List of callables that know how to import templates from various sources. +TEMPLATE_LOADERS = ( + 'django.template.loaders.filesystem.Loader', + 'django.template.loaders.app_directories.Loader', +# 'django.template.loaders.eggs.Loader', +) + +MIDDLEWARE_CLASSES = ( + 'django.middleware.common.CommonMiddleware', +# 'django.contrib.sessions.middleware.SessionMiddleware', +# 'django.middleware.csrf.CsrfViewMiddleware', +# 'django.contrib.auth.middleware.AuthenticationMiddleware', +# 'django.contrib.messages.middleware.MessageMiddleware', + 'pithos.middleware.LoggingConfigMiddleware', + 'pithos.middleware.AuthMiddleware' +) + +ROOT_URLCONF = 'pithos.urls' + +TEMPLATE_DIRS = ( + # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates". + # Always use forward slashes, even on Windows. + # Don't forget to use absolute paths, not relative paths. +) + +INSTALLED_APPS = ( +# 'django.contrib.auth', +# 'django.contrib.contenttypes', +# 'django.contrib.sessions', +# 'django.contrib.sites', +# 'django.contrib.messages', +# 'django.contrib.admin', +# 'django.contrib.admindocs', + 'pithos.im', + 'pithos.api', + 'pithos.public', + 'pithos.ui' +) + +# Set the expiration time of newly created auth tokens +# to be this many hours after their creation time. +AUTH_TOKEN_DURATION = 30 * 24 + +# Default setting for new accounts. +DEFAULT_QUOTA = 50 * 1024 * 1024 * 1024 +DEFAULT_VERSIONING = 'auto' + +# Show these many users per page in admin interface. +ADMIN_PAGE_LIMIT = 100 + +# Authenticate via Twitter. +TWITTER_KEY = '' +TWITTER_SECRET = '' + +# Address to use for outgoing emails +DEFAULT_FROM_EMAIL = 'Pithos ' +FEEDBACK_FROM_EMAIL = DEFAULT_FROM_EMAIL +FEEDBACK_CONTACT_EMAIL = 'support@pithos.grnet.gr' + +INVITATIONS_PER_LEVEL = { + 0 : 100, + 1 : 2, + 2 : 0, + 3 : 0, + 4 : 0 +} + +BASE_URL = '' + +SERVICE_NAME = 'Pithos+' + +SUPPORT_EMAIL = '' + +# Where users should login with their invitation code +INVITATION_LOGIN_TARGET = 'https://pithos.dev.grnet.gr/im/login/invitation' \ + '?code=%d' \ + '&next=https://pithos.dev.grnet.gr/ui' + +# Where users should activate their local account +ACTIVATION_LOGIN_TARGET = BASEPATH + 'im/login/local/activate/' \ + '?auth=%s' \ + '&next=' + BASE_URL + 'im/login' + +# Where users should reset their local password +PASSWORD_RESET_TARGET = BASE_URL + 'im/login/local/reset/' \ + '?auth=%s' \ + '&next=' + BASE_URL + 'im/login?next=' + BASE_URL + 'ui' + + +# The server is behind a proy (apache and gunicorn setup). +USE_X_FORWARDED_HOST = False + +# Use to log to a file. +LOGFILE = None