|
| 1 | +""" |
| 2 | +Django settings for docker_practice project. |
| 3 | +
|
| 4 | +Generated by 'django-admin startproject' using Django 3.1.4. |
| 5 | +
|
| 6 | +For more information on this file, see |
| 7 | +https://docs.djangoproject.com/en/3.1/topics/settings/ |
| 8 | +
|
| 9 | +For the full list of settings and their values, see |
| 10 | +https://docs.djangoproject.com/en/3.1/ref/settings/ |
| 11 | +""" |
| 12 | + |
| 13 | +from pathlib import Path |
| 14 | + |
| 15 | +# Build paths inside the project like this: BASE_DIR / 'subdir'. |
| 16 | +BASE_DIR = Path(__file__).resolve().parent.parent |
| 17 | + |
| 18 | + |
| 19 | +# Quick-start development settings - unsuitable for production |
| 20 | +# See https://docs.djangoproject.com/en/3.1/howto/deployment/checklist/ |
| 21 | + |
| 22 | +# SECURITY WARNING: keep the secret key used in production secret! |
| 23 | +SECRET_KEY = 't8p$t&zx*x4zx!k_lqk-l)aihfq2qnm8%=dq)srhwnrjpi437r' |
| 24 | + |
| 25 | +# SECURITY WARNING: don't run with debug turned on in production! |
| 26 | +DEBUG = True |
| 27 | + |
| 28 | +ALLOWED_HOSTS = [] |
| 29 | + |
| 30 | + |
| 31 | +# Application definition |
| 32 | + |
| 33 | +INSTALLED_APPS = [ |
| 34 | + 'django.contrib.admin', |
| 35 | + 'django.contrib.auth', |
| 36 | + 'django.contrib.contenttypes', |
| 37 | + 'django.contrib.sessions', |
| 38 | + 'django.contrib.messages', |
| 39 | + 'django.contrib.staticfiles', |
| 40 | + |
| 41 | + "rest_framework", |
| 42 | + "rest_framework.authtoken", |
| 43 | + "django_filters", |
| 44 | + "rest_framework_simplejwt", |
| 45 | + 'rest_framework_simplejwt.token_blacklist', |
| 46 | + "corsheaders", |
| 47 | +] |
| 48 | + |
| 49 | +REST_FRAMEWORK = { |
| 50 | + "DEFAULT_AUTHENTICATION_CLASSES": [ |
| 51 | + # "rest_framework.authentication.SessionAuthentication", |
| 52 | + 'rest_framework_simplejwt.authentication.JWTAuthentication' |
| 53 | + ], |
| 54 | + "DEFAULT_PERMISSION_CLASSES": [ |
| 55 | + "rest_framework.permissions.AllowAny", |
| 56 | + ], |
| 57 | + 'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.LimitOffsetPagination', |
| 58 | + 'PAGE_SIZE': 100 |
| 59 | +} |
| 60 | + |
| 61 | +MIDDLEWARE = [ |
| 62 | + 'django.middleware.security.SecurityMiddleware', |
| 63 | + 'django.contrib.sessions.middleware.SessionMiddleware', |
| 64 | + "corsheaders.middleware.CorsMiddleware", |
| 65 | + 'django.middleware.common.CommonMiddleware', |
| 66 | + 'django.middleware.csrf.CsrfViewMiddleware', |
| 67 | + 'django.contrib.auth.middleware.AuthenticationMiddleware', |
| 68 | + 'django.contrib.messages.middleware.MessageMiddleware', |
| 69 | + 'django.middleware.clickjacking.XFrameOptionsMiddleware', |
| 70 | +] |
| 71 | + |
| 72 | +ROOT_URLCONF = 'docker_practice.urls' |
| 73 | + |
| 74 | +TEMPLATES = [ |
| 75 | + { |
| 76 | + 'BACKEND': 'django.template.backends.django.DjangoTemplates', |
| 77 | + 'DIRS': [], |
| 78 | + 'APP_DIRS': True, |
| 79 | + 'OPTIONS': { |
| 80 | + 'context_processors': [ |
| 81 | + 'django.template.context_processors.debug', |
| 82 | + 'django.template.context_processors.request', |
| 83 | + 'django.contrib.auth.context_processors.auth', |
| 84 | + 'django.contrib.messages.context_processors.messages', |
| 85 | + ], |
| 86 | + }, |
| 87 | + }, |
| 88 | +] |
| 89 | + |
| 90 | +WSGI_APPLICATION = 'docker_practice.wsgi.application' |
| 91 | + |
| 92 | + |
| 93 | +# Database |
| 94 | +# https://docs.djangoproject.com/en/3.1/ref/settings/#databases |
| 95 | + |
| 96 | +DATABASES = { |
| 97 | + 'default': { |
| 98 | + 'ENGINE': 'django.db.backends.sqlite3', |
| 99 | + 'NAME': BASE_DIR / 'db.sqlite3', |
| 100 | + } |
| 101 | +} |
| 102 | + |
| 103 | + |
| 104 | +# Password validation |
| 105 | +# https://docs.djangoproject.com/en/3.1/ref/settings/#auth-password-validators |
| 106 | + |
| 107 | +AUTH_PASSWORD_VALIDATORS = [ |
| 108 | + { |
| 109 | + 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', |
| 110 | + }, |
| 111 | + { |
| 112 | + 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', |
| 113 | + }, |
| 114 | + { |
| 115 | + 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', |
| 116 | + }, |
| 117 | + { |
| 118 | + 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', |
| 119 | + }, |
| 120 | +] |
| 121 | + |
| 122 | + |
| 123 | +# Internationalization |
| 124 | +# https://docs.djangoproject.com/en/3.1/topics/i18n/ |
| 125 | + |
| 126 | +LANGUAGE_CODE = 'en-us' |
| 127 | + |
| 128 | +TIME_ZONE = 'Asia/Kolkata' |
| 129 | + |
| 130 | +USE_I18N = True |
| 131 | + |
| 132 | +USE_L10N = True |
| 133 | + |
| 134 | +USE_TZ = True |
| 135 | + |
| 136 | + |
| 137 | +# Static files (CSS, JavaScript, Images) |
| 138 | +# https://docs.djangoproject.com/en/3.1/howto/static-files/ |
| 139 | + |
| 140 | +STATIC_URL = '/static/' |
| 141 | + |
| 142 | +CORS_ORIGIN_ALLOW_ALL = True #Nullify CORS headers issue |
0 commit comments