Statistics
| Branch: | Tag: | Revision:

root / settings.d / 10-database.conf @ 96b635d9

History | View | Annotate | Download (1 kB)

1 1277fb19 Vangelis Koukis
# -*- coding: utf-8 -*-
2 1277fb19 Vangelis Koukis
#
3 1277fb19 Vangelis Koukis
# Database settings
4 1277fb19 Vangelis Koukis
####################
5 1277fb19 Vangelis Koukis
6 1277fb19 Vangelis Koukis
PROJECT_PATH = os.path.dirname(os.path.abspath(__file__)) + '/'
7 1277fb19 Vangelis Koukis
8 1277fb19 Vangelis Koukis
DATABASES = {
9 1277fb19 Vangelis Koukis
    'default': {
10 1277fb19 Vangelis Koukis
        # 'postgresql_psycopg2', 'postgresql','mysql', 'sqlite3' or 'oracle'
11 1277fb19 Vangelis Koukis
        'ENGINE': 'sqlite3',
12 1277fb19 Vangelis Koukis
         # ATTENTION: This *must* be the absolute path if using sqlite3.
13 1277fb19 Vangelis Koukis
         # See: http://docs.djangoproject.com/en/dev/ref/settings/#name
14 1277fb19 Vangelis Koukis
        'NAME': os.path.join(PROJECT_PATH, 'database.sqlite'),
15 1277fb19 Vangelis Koukis
        'USER': '',                      # Not used with sqlite3.
16 1277fb19 Vangelis Koukis
        'PASSWORD': '',                  # Not used with sqlite3.
17 1277fb19 Vangelis Koukis
        # Set to empty string for localhost. Not used with sqlite3.
18 1277fb19 Vangelis Koukis
        'HOST': '',
19 1277fb19 Vangelis Koukis
        # Set to empty string for default. Not used with sqlite3.
20 1277fb19 Vangelis Koukis
        'PORT': '',
21 1277fb19 Vangelis Koukis
    }
22 1277fb19 Vangelis Koukis
}
23 1277fb19 Vangelis Koukis
24 1277fb19 Vangelis Koukis
if DATABASES['default']['ENGINE'].endswith('mysql'):
25 1277fb19 Vangelis Koukis
    DATABASES['default']['OPTIONS'] = {
26 96b635d9 Vangelis Koukis
            'init_command': 'SET storage_engine=INNODB; ' +
27 96b635d9 Vangelis Koukis
                'SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED',
28 1277fb19 Vangelis Koukis
    }