
"""
Django settings for bratzsoft project.

Generated by 'django-admin startproject' using Django 1.11.2.

For more information on this file, see
https://docs.djangoproject.com/en/1.11/topics/settings/

For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.11/ref/settings/
"""

# Database
# https://docs.djangoproject.com/en/1.11/ref/settings/#databases


# Default Database When using Postgres
# default_dburl = 'postgres://ebratz@localhost/bratzsoft'

from .base import *
import os
from dj_database_url import parse as dburl


default_dburl = 'sqlite:///' + os.path.join(BASE_DIR, 'db.sqlite3')

#DATABASES = {
#    'default': {
#        'ENGINE': 'tenant_schemas.postgresql_backend',
#        'NAME': '',
#        'USERNAME': '',
#        ''
#    }
#


DATABASES = { 
    'default': config('DATABASE_URL', default=default_dburl, cast=dburl)     
}

# Only use when forcing use Tenant Schemas
#DATABASES['default']['ENGINE'] = 'tenant_schemas.postgresql_backend'




#Only Needed with Tenant Schemas
#DATABASE_ROUTERS = (
#    'tenant_schemas.routers.TenantSyncRouter',
#)