1. 3rd party 사용
1) package install
ex) crispy
(noori) c:\projects\noori>pip install crispy-bootstrap5
2) 설정
C:\projects\noori\config\settings.py
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
# 3rd Party
'crispy_forms',
'crispy_bootstrap5', # pip install crispy-bootstrap5 필요
#Local
'works.apps.WorksConfig',
'common.apps.CommonConfig',
]
# crispy 적용 관련
CRISPY_ALLOWED_TEMPLATE_PACKS = "bootstrap5"
CRISPY_TEMPLATE_PACK = "bootstrap5"
3) 템플릿 수정
C:\projects\noori\templates\common\base.html
C:\projects\noori\templates\common\home.html
C:\projects\noori\templates\registration\login.html
C:\projects\noori\templates\registration\signup.html
'Django' 카테고리의 다른 글
generic views (0) | 2023.05.06 |
---|---|
함수 views (0) | 2023.05.06 |
Custom User Model(사용자 지정 User Model) (0) | 2023.05.03 |
Django 가상환경 구축 (0) | 2023.04.12 |
댓글