|
| 1 | +from pathlib import Path |
| 2 | + |
| 3 | + |
| 4 | +BASE_DIR = Path(__file__).resolve().parent.parent |
| 5 | + |
| 6 | +SECRET_KEY = "gmkd4-*ew4fv!w8p!9qm(o2-qpmc$&jng-2jm!4l3$x^pn#tmu" |
| 7 | + |
| 8 | +DEBUG = True |
| 9 | + |
| 10 | +ALLOWED_HOSTS = ["*"] |
| 11 | + |
| 12 | +INSTALLED_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 | + "graphene_django", |
| 20 | + "corsheaders", |
| 21 | + "blog", |
| 22 | +] |
| 23 | + |
| 24 | +MIDDLEWARE = [ |
| 25 | + "django.middleware.security.SecurityMiddleware", |
| 26 | + "django.contrib.sessions.middleware.SessionMiddleware", |
| 27 | + "django.middleware.common.CommonMiddleware", |
| 28 | + "django.middleware.csrf.CsrfViewMiddleware", |
| 29 | + "django.contrib.auth.middleware.AuthenticationMiddleware", |
| 30 | + "django.contrib.messages.middleware.MessageMiddleware", |
| 31 | + "django.middleware.clickjacking.XFrameOptionsMiddleware", |
| 32 | + "corsheaders.middleware.CorsMiddleware", |
| 33 | +] |
| 34 | + |
| 35 | +ROOT_URLCONF = "backend.urls" |
| 36 | + |
| 37 | +TEMPLATES = [ |
| 38 | + { |
| 39 | + "BACKEND": "django.template.backends.django.DjangoTemplates", |
| 40 | + "DIRS": [], |
| 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 | + |
| 53 | +WSGI_APPLICATION = "backend.wsgi.application" |
| 54 | + |
| 55 | +DATABASES = { |
| 56 | + "default": { |
| 57 | + "ENGINE": "django.db.backends.sqlite3", |
| 58 | + "NAME": BASE_DIR / "db.sqlite3", |
| 59 | + } |
| 60 | +} |
| 61 | + |
| 62 | +AUTH_PASSWORD_VALIDATORS = [ |
| 63 | + { |
| 64 | + "NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator", |
| 65 | + }, |
| 66 | + { |
| 67 | + "NAME": "django.contrib.auth.password_validation.MinimumLengthValidator", |
| 68 | + }, |
| 69 | + { |
| 70 | + "NAME": "django.contrib.auth.password_validation.CommonPasswordValidator", |
| 71 | + }, |
| 72 | + { |
| 73 | + "NAME": "django.contrib.auth.password_validation.NumericPasswordValidator", |
| 74 | + }, |
| 75 | +] |
| 76 | + |
| 77 | +LANGUAGE_CODE = "en-us" |
| 78 | + |
| 79 | +TIME_ZONE = "UTC" |
| 80 | + |
| 81 | +USE_I18N = True |
| 82 | + |
| 83 | +USE_L10N = True |
| 84 | + |
| 85 | +USE_TZ = True |
| 86 | + |
| 87 | +STATIC_URL = "/static/" |
| 88 | + |
| 89 | +GRAPHENE = { |
| 90 | + "SCHEMA": "blog.schema.schema", |
| 91 | +} |
| 92 | + |
| 93 | +CORS_ORIGIN_ALLOW_ALL = False |
| 94 | +CORS_ORIGIN_WHITELIST = ("http://localhost:8080",) |
0 commit comments