remove path from primary key
[pithos] / pithos / settings.py.dist
index 8563aa1..ad8eb2f 100644 (file)
@@ -1,3 +1,36 @@
+# 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
 
@@ -6,13 +39,7 @@ 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'),
@@ -22,7 +49,7 @@ MANAGERS = ADMINS
 
 DATABASES = {
     'default': {
-        'ENGINE': 'sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
+        '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.
@@ -32,10 +59,20 @@ DATABASES = {
 }
 
 # The backend to use and its initilization options.
-if TEST:
-    BACKEND = ('SimpleBackend', (os.path.join(PROJECT_PATH, 'testdata'),))
-else:
-    BACKEND = ('SimpleBackend', (os.path.join(PROJECT_PATH, 'data'),))
+
+# 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))
+
+# Shibboleth-enabled path for authentication.
+LOGIN_URL = "/login"
+
+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
@@ -86,11 +123,12 @@ TEMPLATE_LOADERS = (
 
 MIDDLEWARE_CLASSES = (
     'django.middleware.common.CommonMiddleware',
-    'django.contrib.sessions.middleware.SessionMiddleware',
+#    'django.contrib.sessions.middleware.SessionMiddleware',
 #    'django.middleware.csrf.CsrfViewMiddleware',
-    'django.contrib.auth.middleware.AuthenticationMiddleware',
-    'django.contrib.messages.middleware.MessageMiddleware',
-    'pithos.middleware.LoggingConfigMiddleware'
+#    'django.contrib.auth.middleware.AuthenticationMiddleware',
+#    'django.contrib.messages.middleware.MessageMiddleware',
+    'pithos.middleware.LoggingConfigMiddleware',
+    'pithos.middleware.AuthMiddleware'
 )
 
 ROOT_URLCONF = 'pithos.urls'
@@ -102,12 +140,25 @@ TEMPLATE_DIRS = (
 )
 
 INSTALLED_APPS = (
-    'django.contrib.auth',
-    'django.contrib.contenttypes',
-    'django.contrib.sessions',
-    'django.contrib.sites',
-    'django.contrib.messages',
+#    'django.contrib.auth',
+#    'django.contrib.contenttypes',
+#    'django.contrib.sessions',
+#    'django.contrib.sites',
+#    'django.contrib.messages',
 #    'django.contrib.admin',
 #    'django.contrib.admindocs',
-    'api'
+    'pithos.aai',
+    'pithos.admin',
+    'pithos.api',
+    'pithos.public'
 )
+
+# Set the expiration time of newly created auth tokens
+# to be this many hours after their creation time.
+AUTH_TOKEN_DURATION = 30 * 24
+
+# Default quota for new users.
+DEFAULT_QUOTA = 10 * 1024 * 1024 * 1024
+
+# Show these many users per page in admin interface.
+ADMIN_PAGE_LIMIT = 100