From c39d978182d345af4d8af8ce591be8ec07e829d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=EC=97=90=EB=85=B9?= Date: Sun, 16 Jul 2023 18:51:05 +0900 Subject: [PATCH] =?UTF-8?q?media=20env=ED=99=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.dist | 6 +++--- project_name/settings/base.py | 14 ++++---------- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/.env.dist b/.env.dist index 03d4598..f5f8f96 100644 --- a/.env.dist +++ b/.env.dist @@ -8,7 +8,7 @@ SECRET_KEY=secret ALLOWED_HOSTS=* # DATABASE -# Format: http://www.postgresql.org/docs/current/static/libpq-connect.html#LIBPQ-CONNSTRING +# Format: https://django-environ.readthedocs.io/en/latest/types.html#environ-env-db-url DATABASE_URL=postgresql://[user[:password]@][netloc][:port][/dbname][?param1=value1&...] # EMAIL @@ -19,5 +19,5 @@ SERVER_EMAIL=webmaster@example.com # CACHE CACHE_URL=rediscache://127.0.0.1:6379/1?client_class=django_redis.client.DefaultClient&password=ungithubbed-secret -# URL PREFIX -URL_PREFIX= +# FILES +MEDIA_ROOT=/path/to/media diff --git a/project_name/settings/base.py b/project_name/settings/base.py index e7a8385..e1db57e 100644 --- a/project_name/settings/base.py +++ b/project_name/settings/base.py @@ -91,15 +91,9 @@ 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator' ), }, - { - 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', - }, - { - 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', - }, - { - 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', - }, + {'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator'}, + {'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator'}, + {'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator'}, ] AUTH_USER_MODEL = 'account.User' @@ -128,7 +122,7 @@ MEDIA_URL = '/media/' -MEDIA_ROOT = BASE_DIR / 'resources/media' +MEDIA_ROOT = env('MEDIA_ROOT') # Default primary key field type