Variable Routing & DTL
Django - The web framework for perfectionists with deadlines
Folder structure
1. Package folder
settings.py
settings.py
Allowed hosts
'*' ์ ๋ชจ๋ ๊ฒ์ ์๋ฏธํ๋ wildcard
Application definition
์๋ก์ด app์ ๋ง๋ค ๋๋ง๋ค ์ถ๊ฐํด์ค์ผํจ
Language setting & Internalization
manage.py
manage.py
๋ช ๋ น์ด๋ฅผ ์คํ ํ ์ ์๋๋ก ๋์์ฃผ๋ ํ์ผ
์์ ํ์ง ๋ง๊ฒ!
2. Apps folder
apps.py
: app ์ค์
admin.py
: ๊ด๋ฆฌ์ view
models.py
: model
tests.py
: ํ ์คํธ
Variable routing
url์ ํน์ ์์น์ ๊ฐ์ ๋ณ์๋ก ํ์ฉ
1. urls.py
2. views.py
3. template
DTL (Django Template Language)
Template file (HTML) ์ django template language๋ฅผ ํตํด ๊ตฌ์ฑํ ์ ์๋ค!
Djangoโs template language is designed to strike a balance between power and ease.
Itโs designed to feel comfortable to those used to working with HTML.
๊ธฐ๋ณธ ๋ฌธ๋ฒ
1. ์ถ๋ ฅ {{ }}
{{ }}
2. ๋ฌธ๋ฒ {% %}
{% %}
Last updated