1. Goeie Jongens
  2. django-environments

Source

django-environments / etc / settings / database.py

Vincent Hillenbr… e3a01df 

Vincent Hillenbr… d9bcd88 
Vincent Hillenbr… e3a01df 

Vincent Hillenbr… 5db39ff 
Vincent Hillenbr… d9bcd88 
Vincent Hillenbr… e99f9ab 
Vincent Hillenbr… 958d7a8 
Vincent Hillenbr… e3a01df 
Vincent Hillenbr… a0508f2 
Vincent Hillenbr… e3a01df 
Vincent Hillenbr… 958d7a8 
Vincent Hillenbr… e3a01df 
Vincent Hillenbr… d9bcd88 
Vincent Hillenbr… 5db39ff 
Vincent Hillenbr… e3a01df 
Vincent Hillenbr… 958d7a8 
Vincent Hillenbr… e3a01df 
Vincent Hillenbr… d9bcd88 
Vincent Hillenbr… 5db39ff 
Vincent Hillenbr… e3a01df 


Vincent Hillenbr… ea0a670 

Vincent Hillenbr… 958d7a8 
Vincent Hillenbr… ea0a670 
from os import path, environ

from .generic import PROJECT_ROOT, PROJECT, DJANGO_PROJECT


DATABASE_NAME = PROJECT

DATABASES_DEFAULT = {
    'sqlite': {
        'ENGINE': 'django.db.backends.sqlite3',
        'NAME': path.join(PROJECT_ROOT, 'db', '%s.sqlite3' % DATABASE_NAME),
    },
    'mysql': {
        'ENGINE': 'django.db.backends.mysql',
        'NAME': DATABASE_NAME,
        'USER': 'mysql',
    },
    'postgres': {
        'ENGINE': 'django.db.backends.postgresql_psycopg2',
        'NAME': DATABASE_NAME,
        'USER': 'postgres',
    }
}

DATABASES = {
    'default':
        DATABASES_DEFAULT[environ.get('DJANGO_DATABASE_TYPE', 'sqlite')]
}