production-taskbar / backend / config / settings / development.py
development.py
Raw
# type: ignore
from socket import gethostbyname_ex, gethostname
from os import environ, path

exec(open('config/settings/common.py').read())

INSTALLED_APPS += [
    'django_extensions',
    'debug_toolbar',
]
MIDDLEWARE += [
    'debug_toolbar.middleware.DebugToolbarMiddleware',
]
hostname, _, ips = gethostbyname_ex(gethostname())
INTERNAL_IPS = [ip[:ip.rfind(".")] + ".1"
                for ip in ips] + ["127.0.0.1", "10.0.2.2"]

SECRET_KEY = environ.get('SECRET_KEY', 'dummy_secret')
CORS_ALLOW_ALL_ORIGINS = True
ALLOWED_HOSTS = ['*']

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True

STATIC_ROOT = path.join(BASE_DIR, 'static')
STATICFILES_DIRS = (path.join('staticfiles'), )
MEDIA_ROOT = path.join(BASE_DIR, 'attachments')

STATIC_URL = '/static/'
MEDIA_URL = '/attachments/'

LOGGING = {
    'version': 1,
    'disable_existing_loggers': False,
    'root': {
        'handlers': ['console'],
        'level': 'INFO',
    },
    'formatters': {
        'verbose': {
            'format': '{levelname} {asctime} {module} {process:d} {thread:d} {message}',
            'style': '{',
        },
        'simple': {
            'format': '{levelname} {message}',
            'style': '{',
        },
    },
    'handlers': {
        'console': {
            'level': 'DEBUG',
            'class': 'logging.StreamHandler',
            'formatter': 'simple'
        },
    },
    'loggers': {
        'django': {
            'handlers': ['console'],
            'level': 'INFO',
            'propagate': False,
        },
        'django_python3_ldap': {
            'handlers': ['console'],
            'level': 'DEBUG',
        }
    },
}

GRAPH_MODELS = {
    'all_applications': False,
    'group_models': True,
    'rankdir': 'LR',
    'app_labels': ['taskbar', 'helpdesk', 'informing', 'links'],
    'exclude_models': ['Historical*'],
    'output': 'project_visualization.png',
}

REST_FRAMEWORK = {
    "DEFAULT_PERMISSION_CLASSES": [
        "rest_framework_api_key.permissions.HasAPIKey",
    ],
    'DEFAULT_THROTTLE_CLASSES': [
        'config.utils.throttles.NoApiKeyAnonRateThrottle',
    ],
    'DEFAULT_THROTTLE_RATES': {
        'noapikey': '10/hour',
    }
}