- startproject helloidol2
- python -m pip install django~=4.2
- django-admin startproject helloidol2 .
- File > Settings... > Language & Framework > Django > [v] Enavle Django Support
- Run > Edit Configurations... > + > Django Server > Name: runservr
- VCS > Enable Version Control Intergration... > git >` ok
- startapp DontStarve
- python manage.py startapp DontStarve
- 'DontStarve', int INSTALLED_APPS in settings.py
- DontStarve/
- models
- Character
- name, description, created_at, updated_at
- photo
- python -m pip install pillow
__str__(): 객체를 출력할 때, 알맞은 string으로 출력하기 위해 만든다get_absolute_url(): 캐릭터 하나 데이터 가져오자
- python manage.py makemigrations DontStarve
- python manage.py migrate
- Character
- admin
- Character
- python manage.py createsuperuser
- views
- R: CharacterListView
- R: CharacterDetailView
- C: CharacterCreateView
- add 'photo' in fields
- U: CharacterUpdateView
- add 'photo' in fields
- D: CharacterDeleteView
- templates/DontStarve/
- character_list.html
- {{ character.photo.url }}
- character_detail.html
- {{ character.photo.url }}
- character_create.html
- enctype="multipart/form-data"
- character_update.html
- enctype="multipart/form-data"
- character_confirm_delete.html
- character_list.html
- urls
- DontStarve: character_list
- DontStarve: character_detail
- DontStarve: character_create
- DontStarve: character_update
- DontStarve: character_delete
- static/DontStarve/
- photo/no_photo
- settings
- STATICFIELS_DIRS
- models
- helloidol2/
- urls
- MEDIA
- settings
- MEDIA_ROOT, MEDIA_URL
- urls
- templates
- hase.html
- settings.py > TEMPLATES
- ['BASE_DIR' / 'templates']
- settings.py > TEMPLATES
- hase.html
Folders and files
| Name | Name | Last commit date | ||
|---|---|---|---|---|