Revision 5505e60c

b/snf-webproject/synnefo/webproject/settings/__init__.py
36 36
from synnefo.util.entry_points import extend_list_from_entry_point, \
37 37
        extend_dict_from_entry_point
38 38

  
39

  
40
# Provide common django settings and extend them from entry_point hooks
41
INSTALLED_APPS = (
42
    'django.contrib.contenttypes',
43
    'django.contrib.sessions',
44
    'django.contrib.sites',
45
    'django.contrib.messages',
46
    'django.contrib.admin',
47
    'south',
48
    'synnefo.webproject'
49
)
39 50
INSTALLED_APPS = extend_list_from_entry_point(INSTALLED_APPS, 'synnefo', \
40 51
        'web_apps')
52

  
53

  
54
TEMPLATE_CONTEXT_PROCESSORS = (
55
    'django.core.context_processors.request',
56
    'django.core.context_processors.i18n',
57
    'django.contrib.auth.context_processors.auth',
58
    'django.core.context_processors.media'
59
)
60
TEMPLATE_CONTEXT_PROCESSORS = extend_list_from_entry_point(
61
        TEMPLATE_CONTEXT_PROCESSORS, 'synnefo', 'web_context_processors')
62

  
63

  
64
MIDDLEWARE_CLASSES = (
65
    'django.contrib.sessions.middleware.SessionMiddleware',
66
    'django.middleware.locale.LocaleMiddleware',
67
    'django.middleware.common.CommonMiddleware',
68
    'django.contrib.messages.middleware.MessageMiddleware',
69
    'synnefo.lib.middleware.LoggingConfigMiddleware'
70
)
41 71
MIDDLEWARE_CLASSES = extend_list_from_entry_point(MIDDLEWARE_CLASSES, \
42 72
        'synnefo', 'web_middleware')
73

  
74

  
43 75
STATIC_FILES = extend_dict_from_entry_point(STATIC_FILES, 'synnefo', \
44 76
        'web_static')
45
TEMPLATE_CONTEXT_PROCESSORS = extend_list_from_entry_point(
46
        TEMPLATE_CONTEXT_PROCESSORS, 'synnefo', 'web_context_processors')
77

  
78

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

  
35
#
36
# Core Django settings
3
# Core Django project settings
37 4
##################################
38 5

  
39
INSTALLED_APPS = (
40
    'django.contrib.contenttypes',
41
    'django.contrib.sessions',
42
    'django.contrib.sites',
43
    'django.contrib.messages',
44
    'django.contrib.admin',
45
    'south',
46
    'synnefo.webproject'
47
)
48

  
49 6
SESSION_ENGINE = "django.contrib.sessions.backends.cached_db"
50 7

  
51 8
# List of callables that know how to import templates from various sources.
52 9
TEMPLATE_LOADERS = (
53 10
    'django.template.loaders.filesystem.Loader',
54 11
    'django.template.loaders.app_directories.Loader',
55
#     'django.template.loaders.eggs.Loader',
56
)
57

  
58
TEMPLATE_CONTEXT_PROCESSORS = (
59
    'django.core.context_processors.request',
60
    'django.core.context_processors.i18n',
61
    'django.contrib.auth.context_processors.auth',
62
    'django.core.context_processors.media'
63
)
64

  
65
MIDDLEWARE_CLASSES = (
66
    'django.contrib.sessions.middleware.SessionMiddleware',
67
    'django.middleware.locale.LocaleMiddleware',
68
    'django.middleware.common.CommonMiddleware',
69
    'django.contrib.messages.middleware.MessageMiddleware',
70
    'synnefo.lib.middleware.LoggingConfigMiddleware'
71 12
)
72 13

  
14
# This is a django project setting, do not change this unless you know
15
# what you're doing
73 16
ROOT_URLCONF = 'synnefo.webproject.urls'
74 17

  
18
# Additional template dirs.
75 19
TEMPLATE_DIRS = (
76
    # Put strings here, like "/home/html/django_templates"
77
    # or "C:/www/django/templates".
78
    # Always use forward slashes, even on Windows.
79
    # Don't forget to use absolute paths, not relative paths.
20
    '/usr/share/synnefo/templates/'
80 21
)
81 22

  
82 23
LANGUAGES = (
83
  #('el', u'Ελληνικά'),
84 24
  ('en', 'English'),
85 25
)
86 26

  
b/snf-webproject/synnefo/webproject/settings/default/database.py
1
# -*- coding: utf-8 -*-
2
#
3 1
# Database settings
4 2
####################
5 3

  
6
import os
7 4

  
8
DEFAULT_DB_PATH = '/usr/share/synnefo/'
9 5
DATABASES = {
10 6
    'default': {
11
        # 'postgresql_psycopg2', 'postgresql','mysql', 'sqlite3' or 'oracle'
7
        # Available values 'postgresql_psycopg2', 'postgresql','mysql',
8
        # 'sqlite3' or 'oracle'
12 9
        'ENGINE': 'sqlite3',
10

  
13 11
         # ATTENTION: This *must* be the absolute path if using sqlite3.
14 12
         # See: http://docs.djangoproject.com/en/dev/ref/settings/#name
15
        'NAME': os.path.join(DEFAULT_DB_PATH, 'database.sqlite'),
13
        'NAME': '/usr/share/synnefo/synnefo_database.sqlite',
14

  
16 15
        'USER': '',                      # Not used with sqlite3.
16

  
17 17
        'PASSWORD': '',                  # Not used with sqlite3.
18 18
        # Set to empty string for localhost. Not used with sqlite3.
19

  
19 20
        'HOST': '',
21

  
20 22
        # Set to empty string for default. Not used with sqlite3.
21 23
        'PORT': '',
24

  
25
        # Uncomment the following lines if you use mysql database
26
        #'OPTIONS': {
27
        #    'init_command': 'SET storage_engine=INNODB; ' +
28
        #        'SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED',
29
        #}
22 30
    }
23 31
}
24 32

  
25
if DATABASES['default']['ENGINE'].endswith('mysql'):
26
    DATABASES['default']['OPTIONS'] = {
27
            'init_command': 'SET storage_engine=INNODB; ' +
28
                'SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED',
29
    }
b/snf-webproject/synnefo/webproject/settings/default/deploy.py
1
# -*- coding: utf-8 -*-
2
#
3
# Deployment
1
# Deployment settings
4 2
##################################
5 3

  
6 4
DEBUG = False
7
TEMPLATE_DEBUG = DEBUG
5
TEMPLATE_DEBUG = False
8 6

  
7
# You should always change this setting.
9 8
# Make this unique, and don't share it with anybody.
10 9
SECRET_KEY = 'ly6)mw6a7x%n)-e#zzk4jo6f2=uqu!1o%)2-(7lo+f9yd^k^bg'

Also available in: Unified diff