Exemplo n.º 1
0

# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/3.1/howto/static-files/

STATIC_URL = '/static/'

OPENCENSUS = {
    'TRACE': {
        'SAMPLER': 'opencensus.trace.samplers.ProbabilitySampler(rate=1)',
        'EXPORTER': f'''opencensus.ext.azure.trace_exporter.AzureExporter(
            connection_string="{env.str('APPLICATIONINSIGHTS_CONNECTION_STRING')}"
        )''',
        # 'BLACKLIST_PATHS': ['https://example.com'],
    },
}

if 'SENTRY_DSN' in env:
    import sentry_sdk
    from sentry_sdk.integrations.django import DjangoIntegration

    sentry_sdk.init(
        dsn=env.str('SENTRY_DSN'),
        integrations=[DjangoIntegration()],
        traces_sample_rate=env.float('SENTRY_TRACES_SAMPLE_RATE', 0.0),

        # If you wish to associate users to errors (assuming you are using
        # django.contrib.auth) you may enable sending PII data.
        send_default_pii=True
    )
Exemplo n.º 2
0
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = env.str('SECRET_KEY', 'n-re&be(pq$!neq6bvit5z&wz^oh^ovztcl=1dwgtelx*8dj0-')

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = env.bool('DEBUG', True)

ALLOWED_HOSTS = ['*']

CORS_ORIGIN_ALLOW_ALL = True

# Models

MASK_DETECTION_LEARNER = get_mask_detection_learner()
FACE_DETECTION_MODEL = get_face_detection_model()

FACE_DETECTION_CONFIDENCE = env.float('FACE_DETECTION_CONFIDENCE', 0.4)
FACE_DETECTION_THRESHOLD = env.float('FACE_DETECTION_THRESHOLD', 0.4)
PROPER_MASK_DETECTION_THRESHOLD = env.float('PROPER_MASK_DETECTION_THRESHOLD', 0.95)
IMPROPER_MASK_DETECTION_THRESHOLD = env.float('IMPROPER_MASK_DETECTION_THRESHOLD', 0.80)

# Application definition

INSTALLED_APPS = [
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',

    'rest_framework',