Support local accounts & recover password
[pithos] / pithos / settings.py.dist
index 51fc258..df3c426 100644 (file)
-# Django settings for pithos project.\r
-import os\r
-\r
-PROJECT_PATH = os.path.dirname(os.path.abspath(__file__)) + '/'\r
-\r
-DEBUG = True\r
-TEMPLATE_DEBUG = DEBUG\r
-\r
-# A quick-n-dirty way to know if we're running unit tests\r
-import sys\r
-TEST = False\r
-if len(sys.argv) >= 2:\r
-    if os.path.basename(sys.argv[0]) == 'manage.py' and \\r
-        (sys.argv[1] == 'test' or sys.argv[1] == 'hudson'):\r
-            TEST = True\r
-\r
-ADMINS = (\r
-    # ('Your Name', 'your_email@domain.com'),\r
-)\r
-\r
-MANAGERS = ADMINS\r
-\r
-DATABASES = {\r
-    'default': {\r
-        'ENGINE': 'sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.\r
-        'NAME': PROJECT_PATH + 'pithos.db',            # Or path to database file if using sqlite3.\r
-        'USER': '',                      # Not used with sqlite3.\r
-        'PASSWORD': '',                  # Not used with sqlite3.\r
-        'HOST': '',                      # Set to empty string for localhost. Not used with sqlite3.\r
-        'PORT': '',                      # Set to empty string for default. Not used with sqlite3.\r
-    }\r
-}\r
-\r
-# Local time zone for this installation. Choices can be found here:\r
-# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name\r
-# although not all choices may be available on all operating systems.\r
-# On Unix systems, a value of None will cause Django to use the same\r
-# timezone as the operating system.\r
-# If running in a Windows environment this must be set to the same as your\r
-# system time zone.\r
-TIME_ZONE = 'UTC'\r
-\r
-# Language code for this installation. All choices can be found here:\r
-# http://www.i18nguy.com/unicode/language-identifiers.html\r
-LANGUAGE_CODE = 'en-us'\r
-\r
-SITE_ID = 1\r
-\r
-# If you set this to False, Django will make some optimizations so as not\r
-# to load the internationalization machinery.\r
-USE_I18N = True\r
-\r
-# If you set this to False, Django will not format dates, numbers and\r
-# calendars according to the current locale\r
-USE_L10N = True\r
-\r
-# Absolute filesystem path to the directory that will hold user-uploaded files.\r
-# Example: "/home/media/media.lawrence.com/"\r
-MEDIA_ROOT = ''\r
-\r
-# URL that handles the media served from MEDIA_ROOT. Make sure to use a\r
-# trailing slash if there is a path component (optional in other cases).\r
-# Examples: "http://media.lawrence.com", "http://example.com/media/"\r
-MEDIA_URL = ''\r
-\r
-# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a\r
-# trailing slash.\r
-# Examples: "http://foo.com/media/", "/media/".\r
-ADMIN_MEDIA_PREFIX = '/media/'\r
-\r
-# Make this unique, and don't share it with anybody.\r
-SECRET_KEY = '$j0cdrfm*0sc2j+e@@2f-&3-_@2=^!z#+b-8o4_i10@2%ev7si'\r
-\r
-# List of callables that know how to import templates from various sources.\r
-TEMPLATE_LOADERS = (\r
-    'django.template.loaders.filesystem.Loader',\r
-    'django.template.loaders.app_directories.Loader',\r
-#     'django.template.loaders.eggs.Loader',\r
-)\r
-\r
-MIDDLEWARE_CLASSES = (\r
-    'django.middleware.common.CommonMiddleware',\r
-    'django.contrib.sessions.middleware.SessionMiddleware',\r
-#    'django.middleware.csrf.CsrfViewMiddleware',\r
-    'django.contrib.auth.middleware.AuthenticationMiddleware',\r
-    'django.contrib.messages.middleware.MessageMiddleware',\r
-    'pithos.middleware.LoggingConfigMiddleware'\r
-)\r
-\r
-ROOT_URLCONF = 'pithos.urls'\r
-\r
-TEMPLATE_DIRS = (\r
-    # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".\r
-    # Always use forward slashes, even on Windows.\r
-    # Don't forget to use absolute paths, not relative paths.\r
-)\r
-\r
-INSTALLED_APPS = (\r
-    'django.contrib.auth',\r
-    'django.contrib.contenttypes',\r
-    'django.contrib.sessions',\r
-    'django.contrib.sites',\r
-    'django.contrib.messages',\r
-#    'django.contrib.admin',\r
-#    'django.contrib.admindocs',\r
-    'api'\r
-)\r
+# 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 <no-reply@grnet.gr>'
+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