Git-environ에서 이슈가 존재하여, 문의드립니다. `environ`이 import가 되지 않는 문제
410
SejeongPark
작성한 질문수 6
0

environ 에서 다음과 같은 문제가 나오는데, 관련 샘플이 해당 오류의 원인을 찾지 못하겠습니다.
다음은 세팅 파일 전문입니다.
"""
Django settings for pragmatic project.
Generated by 'django-admin startproject' using Django 4.1.5.
For more information on this file, see
https://docs.djangoproject.com/en/4.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/4.1/ref/settings/
"""
from pathlib import Path
import os
import environ
env = environ.Env(
# set casting, default value
DEBUG=(bool, False)
)
# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# Take environment variables from .env file
environ.Env.read_env(os.path.join(BASE_DIR, '.env'))
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/4.1/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = env('SECRET_KEY')
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = env('DEBUG')
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'accountapp',
]
MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]
ROOT_URLCONF = 'pragmatic.urls'
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]
WSGI_APPLICATION = 'pragmatic.wsgi.application'
# Database
# https://docs.djangoproject.com/en/4.1/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': BASE_DIR / 'db.sqlite3',
}
}
# Password validation
# https://docs.djangoproject.com/en/4.1/ref/settings/#auth-password-validators
AUTH_PASSWORD_VALIDATORS = [
{
'NAME': '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',
},
]
# Internationalization
# https://docs.djangoproject.com/en/4.1/topics/i18n/
LANGUAGE_CODE = 'en-us'
TIME_ZONE = 'UTC'
USE_I18N = True
USE_TZ = True
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/4.1/howto/static-files/
STATIC_URL = 'static/'
# Default primary key field type
# https://docs.djangoproject.com/en/4.1/ref/settings/#default-auto-field
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
답변 0
강의에 나왔던 js 파일이 깃허브에 없습니다
1
69
1
모바일 디버깅, 반응형 레이아웃 4분48초 질문
0
48
1
decorator 관련질문입니다.
0
52
1
PasswordChangeView
0
96
2
로그아웃뷰 작동 관련 (2025년 3월)
1
130
1
실행에러질문
0
149
1
@login_required 데코레이터 사용시 리다이렉트는 어디서 참조하여 설정을 하는걸까요?
0
112
1
CacheBackend 관련 에러
0
172
1
21강 CreateView를 통한 회원가입 구현 질문
0
323
1
53강 disallowedhost
0
337
2
502 Bad Gateway
0
471
0
mariadb 접근권한 오류
0
536
1
logout 후 빈 화면으로 이동합니다 ㅠㅠ
0
453
2
로그아웃 후 빈 화면으로 이동
0
325
1
서버 운영 관련 질문 드립니다.(Unable to retirve...)
0
230
1
static/base.css파일을 인식을 못합니다
0
375
1
안녕하세요 19강 디버깅 설정 질문있습니다.
0
289
1
프로필 update편 질문있습니다.
0
375
1
수업질문
0
390
1
COOP error
0
525
1
61강 Dockerfile error
0
594
1
static안에 base.css 에서 정의한 클래스가 적용되지 않습니다.
0
487
1
static 파일 중 jpg 파일만 로드 불가
0
415
1
58강 static 파일 적용 안됨
0
543
1





