Statistics
| Branch: | Tag: | Revision:

root / settings.d / 10-database.conf @ ccd0d474

History | View | Annotate | Download (2.5 kB)

1 1277fb19 Vangelis Koukis
# -*- coding: utf-8 -*-
2 1277fb19 Vangelis Koukis
3 1277fb19 Vangelis Koukis
# Copyright 2011 GRNET S.A. All rights reserved.
4 1277fb19 Vangelis Koukis
# 
5 1277fb19 Vangelis Koukis
# Redistribution and use in source and binary forms, with or
6 1277fb19 Vangelis Koukis
# without modification, are permitted provided that the following
7 1277fb19 Vangelis Koukis
# conditions are met:
8 1277fb19 Vangelis Koukis
# 
9 1277fb19 Vangelis Koukis
#   1. Redistributions of source code must retain the above
10 1277fb19 Vangelis Koukis
#      copyright notice, this list of conditions and the following
11 1277fb19 Vangelis Koukis
#      disclaimer.
12 1277fb19 Vangelis Koukis
# 
13 1277fb19 Vangelis Koukis
#   2. Redistributions in binary form must reproduce the above
14 1277fb19 Vangelis Koukis
#      copyright notice, this list of conditions and the following
15 1277fb19 Vangelis Koukis
#      disclaimer in the documentation and/or other materials
16 1277fb19 Vangelis Koukis
#      provided with the distribution.
17 1277fb19 Vangelis Koukis
# 
18 1277fb19 Vangelis Koukis
# THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS
19 1277fb19 Vangelis Koukis
# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20 1277fb19 Vangelis Koukis
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
21 1277fb19 Vangelis Koukis
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR
22 1277fb19 Vangelis Koukis
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 1277fb19 Vangelis Koukis
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 1277fb19 Vangelis Koukis
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
25 1277fb19 Vangelis Koukis
# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
26 1277fb19 Vangelis Koukis
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 1277fb19 Vangelis Koukis
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
28 1277fb19 Vangelis Koukis
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 1277fb19 Vangelis Koukis
# POSSIBILITY OF SUCH DAMAGE.
30 1277fb19 Vangelis Koukis
# 
31 1277fb19 Vangelis Koukis
# The views and conclusions contained in the software and
32 1277fb19 Vangelis Koukis
# documentation are those of the authors and should not be
33 1277fb19 Vangelis Koukis
# interpreted as representing official policies, either expressed
34 1277fb19 Vangelis Koukis
# or implied, of GRNET S.A.
35 1277fb19 Vangelis Koukis
# 
36 1277fb19 Vangelis Koukis
# -*- coding: utf-8 -*-
37 1277fb19 Vangelis Koukis
38 1277fb19 Vangelis Koukis
#
39 1277fb19 Vangelis Koukis
# Database settings
40 1277fb19 Vangelis Koukis
####################
41 1277fb19 Vangelis Koukis
42 1277fb19 Vangelis Koukis
PROJECT_PATH = os.path.dirname(os.path.abspath(__file__)) + '/'
43 1277fb19 Vangelis Koukis
44 1277fb19 Vangelis Koukis
DATABASES = {
45 1277fb19 Vangelis Koukis
    'default': {
46 1277fb19 Vangelis Koukis
        # 'postgresql_psycopg2', 'postgresql','mysql', 'sqlite3' or 'oracle'
47 1277fb19 Vangelis Koukis
        'ENGINE': 'sqlite3',
48 1277fb19 Vangelis Koukis
         # ATTENTION: This *must* be the absolute path if using sqlite3.
49 1277fb19 Vangelis Koukis
         # See: http://docs.djangoproject.com/en/dev/ref/settings/#name
50 1277fb19 Vangelis Koukis
        'NAME': os.path.join(PROJECT_PATH, 'database.sqlite'),
51 1277fb19 Vangelis Koukis
        'USER': '',                      # Not used with sqlite3.
52 1277fb19 Vangelis Koukis
        'PASSWORD': '',                  # Not used with sqlite3.
53 1277fb19 Vangelis Koukis
        # Set to empty string for localhost. Not used with sqlite3.
54 1277fb19 Vangelis Koukis
        'HOST': '',
55 1277fb19 Vangelis Koukis
        # Set to empty string for default. Not used with sqlite3.
56 1277fb19 Vangelis Koukis
        'PORT': '',
57 1277fb19 Vangelis Koukis
    }
58 1277fb19 Vangelis Koukis
}
59 1277fb19 Vangelis Koukis
60 1277fb19 Vangelis Koukis
if DATABASES['default']['ENGINE'].endswith('mysql'):
61 1277fb19 Vangelis Koukis
    DATABASES['default']['OPTIONS'] = {
62 1277fb19 Vangelis Koukis
        'init_command': 'SET storage_engine=INNODB',
63 1277fb19 Vangelis Koukis
    }