"""
This is a home for shared dev settings.  Feel free to add anything that all
devs should have set.

Add `from dev_settings import *` to the top of your localsettings file to use.
You can then override or append to any of these settings there.
"""
import os

LOCAL_APPS = (
    'django_extensions',
)

####### Django Extensions #######
# These things will be imported when you run ./manage.py shell_plus
SHELL_PLUS_POST_IMPORTS = (
    # Models
    ('corehq.apps.domain.models', 'Domain'),
    ('corehq.apps.groups.models', 'Group'),
    ('corehq.apps.locations.models', 'Location'),
    ('corehq.apps.users.models', ('CommCareUser', 'CommCareCase')),
    ('couchforms.models', 'XFormInstance'),

    # Data querying utils
    ('dimagi.utils.couch.database', 'get_db'),
    ('corehq.apps.sofabed.models', ('FormData', 'CaseData')),
    ('corehq.apps.es', '*'),
)

ALLOWED_HOSTS = ['*']
FIX_LOGGER_ERROR_OBFUSCATION = True

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql_psycopg2',
        'NAME': 'commcarehq',
        'USER': 'commcarehq',
        'PASSWORD': 'commcarehq',
        'HOST': 'localhost',
        'PORT': '5432'
    }
}

BOWER_PATH = os.popen('which bower').read().strip()

"""
This is a home for shared dev settings.  Feel free to add anything that all
devs should have set.

Add `from dev_settings import *` to the top of your localsettings file to use.
You can then override or append to any of these settings there.
"""
import os

LOCAL_APPS = (
    'django_extensions',
)

####### Django Extensions #######
# These things will be imported when you run ./manage.py shell_plus
SHELL_PLUS_POST_IMPORTS = (
    # Models
    ('corehq.apps.domain.models', 'Domain'),
    ('corehq.apps.groups.models', 'Group'),
    ('corehq.apps.locations.models', 'Location'),
    ('corehq.apps.users.models', ('CommCareUser', 'CommCareCase')),
    ('couchforms.models', 'XFormInstance'),

    # Data querying utils
    ('dimagi.utils.couch.database', 'get_db'),
    ('corehq.apps.sofabed.models', ('FormData', 'CaseData')),
    ('corehq.apps.es', '*'),
)

ALLOWED_HOSTS = ['*']
FIX_LOGGER_ERROR_OBFUSCATION = True

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql_psycopg2',
        'NAME': 'commcarehq',
        'USER': 'commcarehq',
        'PASSWORD': 'commcarehq',
        'HOST': 'localhost',
        'PORT': '5432'
    }
}

BOWER_PATH = os.popen('which bower').read().strip()

CACHES = {'default': {'BACKEND': 'django.core.cache.backends.dummy.DummyCache'}}

Add dummy cache setting so code can be loaded
Add dummy cache setting so code can be loaded

I mimic what will happen on ReadTheDocs locally by doing the following:

 * Don't start my hq environment (no couch, pillowtop, redis, etc)
 * Enter my hq virtualenv
 * Move or rename `localsettings.py` so it won't be found
 * `$ cd docs/`
 * `$ make html`

Basically it needs to be able to import stuff without having a
localsettings (I just put the essentials in `dev_settings.py`) or db
connection.

In the past we've had some singleton-type objects which are
initialized on import and require a db connection to init.  These need
to either be lazily initialized (you can then memoize it to keep it a
singleton), or mocked out in `docs/conf.py`.
