CoolFace
Apppublic

ktongue/material_identification

sourceHugging Facemitupdated 7mo agoView on Hugging Face
0likes
settings.py92 linesDownload Raw Back to root
1import os2from pathlib import Path3 4BASE_DIR = Path(__file__).resolve().parent5 6SECRET_KEY = 'django-insecure-change-me-in-production'7 8DEBUG = True9 10ALLOWED_HOSTS = ['*']11 12INSTALLED_APPS = [13    'django.contrib.admin',14    'django.contrib.auth',15    'django.contrib.contenttypes',16    'django.contrib.sessions',17    'django.contrib.messages',18    'django.contrib.staticfiles',19    'rest_framework',20    'whitenoise.runserver_nostatic',21    'backend.core',22]23 24MIDDLEWARE = [25    'django.middleware.security.SecurityMiddleware',26    'whitenoise.middleware.WhiteNoiseMiddleware',27    'django.contrib.sessions.middleware.SessionMiddleware',28    'django.middleware.common.CommonMiddleware',29    'django.middleware.csrf.CsrfViewMiddleware',30    'django.contrib.auth.middleware.AuthenticationMiddleware',31    'django.contrib.messages.middleware.MessageMiddleware',32    'django.middleware.clickjacking.XFrameOptionsMiddleware',33]34 35ROOT_URLCONF = 'backend.backend.urls'36 37TEMPLATES = [38    {39        'BACKEND': 'django.template.backends.django.DjangoTemplates',40        'DIRS': [BASE_DIR / 'frontend' / 'dist'],41        'APP_DIRS': True,42        'OPTIONS': {43            'context_processors': [44                'django.template.context_processors.debug',45                'django.template.context_processors.request',46                'django.contrib.auth.context_processors.auth',47                'django.contrib.messages.context_processors.messages',48            ],49        },50    },51]52 53WSGI_APPLICATION = 'backend.wsgi.application'54 55DATABASES = {56    'default': {57        'ENGINE': 'django.db.backends.sqlite3',58        'NAME': BASE_DIR / 'db.sqlite3',59    }60}61 62AUTH_PASSWORD_VALIDATORS = [63    {'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator'},64    {'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator'},65    {'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator'},66    {'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator'},67]68 69LANGUAGE_CODE = 'en-us'70TIME_ZONE = 'UTC'71USE_I18N = True72USE_TZ = True73 74STATIC_URL = '/static/'75STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')76STATICFILES_DIRS = [77    os.path.join(BASE_DIR, 'static'),78]79STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'80 81DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'82 83REST_FRAMEWORK = {84    'DEFAULT_PARSER_CLASSES': [85        'rest_framework.parsers.JSONParser',86    ],87    'DEFAULT_RENDERER_CLASSES': [88        'rest_framework.renderers.JSONRenderer',89    ],90}91 92CORS_ALLOW_ALL_ORIGINS = True