<gh_stars>1-10
# -*- coding: utf-8 -*-
from .base import *


DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql_psycopg2',
        'NAME': '{}_local'.format(PROJECT_NAME),
        'USER': 'postgres',
        'PASSWORD': '<PASSWORD>',
        'HOST': '',
        'PORT': '',
    }
}

DEBUG = True
ALLOWED_HOSTS = ['localhost', '127.0.0.1', '[::1]']
STATUS_PROJECT = 'local'
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
INTERNAL_IPS = ['127.0.0.1']
INSTALLED_APPS += ('debug_toolbar',)

DEBUG_TOOLBAR_PANELS = [
    'debug_toolbar.panels.versions.VersionsPanel',
    'debug_toolbar.panels.timer.TimerPanel',
    'debug_toolbar.panels.settings.SettingsPanel',
    'debug_toolbar.panels.headers.HeadersPanel',
    'debug_toolbar.panels.request.RequestPanel',
    'debug_toolbar.panels.sql.SQLPanel',
    'debug_toolbar.panels.staticfiles.StaticFilesPanel',
    'debug_toolbar.panels.templates.TemplatesPanel',
    'debug_toolbar.panels.cache.CachePanel',
    'debug_toolbar.panels.signals.SignalsPanel',
    'debug_toolbar.panels.logging.LoggingPanel',
    'debug_toolbar.panels.redirects.RedirectsPanel',
    'debug_toolbar.panels.profiling.ProfilingPanel',
]

MIDDLEWARE += (
    'debug_toolbar.middleware.DebugToolbarMiddleware',
    'querycount.middleware.QueryCountMiddleware'
)

QUERYCOUNT = {
    'THRESHOLDS': {
        'MEDIUM': 20,
        'HIGH': 50,
        'MIN_TIME_TO_LOG': 0,
        'MIN_QUERY_COUNT_TO_LOG': 0
    },
    'IGNORE_REQUEST_PATTERNS': [r'^/admin/', r'^/media/'],
    'IGNORE_SQL_PATTERNS': [],
    'DISPLAY_DUPLICATES': 5,
    'RESPONSE_HEADER': 'X-DjangoQueryCount-Count'
}

REST_FRAMEWORK['DEFAULT_AUTHENTICATION_CLASSES']\
    .append('rest_framework.authentication.SessionAuthentication')
