settings.py
파일의 내용은 크게 다음 부분으로 나눌 수 있다.
파일 : C:\workspace\django\conf\settings.py
DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), } } |
TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': [os.path.join(BASE_DIR, 'templates')], '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', ], }, }, ] |
프로젝트 기본 설정값은 위와 같으며 templates
디렉토리 이름을 변경하고자 할 경우 DIRS
변수를 수정한다.
'DIRS': [os.path.join(BASE_DIR, 'templates')], |
LANGUAGE_CODE와 TIME_ZONE을 변경합니다.
LANGUAGE_CODE = 'ko-kr' TIME_ZONE = 'Asia/Seoul' USE_I18N = True USE_L10N = True USE_TZ = True |
프로젝트 기본 설정값은 STATIC_URL = 'static' 이며 아래와 같이 STATIC_ROOT
변수를 추가한다.
STATIC_URL = '/static/' STATIC_ROOT = os.path.join(BASE_DIR, 'static') |
프로젝트 기본 설정값은 없으며 파일 업로드 기능 구현을 위해 다음 설정을 추가한다.
MEDIA_URL = '/media/' MEDIA_ROOT = os.path.join(BASE_DIR, 'media') |
|