์ผ | ์ | ํ | ์ | ๋ชฉ | ๊ธ | ํ |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
- ํ๋ก๊ทธ๋๋จธ์ค
- Leveraging Slot Descriptions for Zero-Shot Cross-Domain Dialogue State Tracking
- Python
- ์์ฐ์ด์ฒ๋ฆฌ ๋ ผ๋ฌธ ๋ฆฌ๋ทฐ
- Zero-shot transfer learning with synthesized data for multi-domain dialogue state tracking
- ํ์ด์ฌ์ ํ์ด์ฌ๋ต๊ฒ
- dialogue state tracking
- 2020์ ๋ณด์ฒ๋ฆฌ๊ธฐ์ฌํ๊ธฐ
- DST fewshot learning
- From Machine Reading Comprehension to Dialogue State Tracking: Bridging the Gap
- few shot dst
- ์ ๋ณด์ฒ๋ฆฌ๊ธฐ์ฌ ์์ ๋น
- fasttext text classification ํ๊ธ
- til
- ๋ชจ๋์๋ฅ๋ฌ๋
- ์ ๋ณด์ฒ๋ฆฌ๊ธฐ์ฌ ์ฑ ์ถ์ฒ
- ๋ฐ์ดํฐ ํฉ์ฑ
- ์ ๋ณด์ฒ๋ฆฌ๊ธฐ์ฌ์ ๊ณต์ํฉ๊ฒฉํ๊ธฐ
- nlp๋ ผ๋ฌธ๋ฆฌ๋ทฐ
- Few Shot Dialogue State Tracking using Meta-learning
- ๋ฅ๋ฌ๋๊ธฐ์ด
- How Much Knowledge Can You Pack Into the Parameters of a Language Model?
- SUMBT:Slot-Utterance Matching for Universal and Scalable Belief Tracking
- MySQL
- ์ ๋ณด์ฒ๋ฆฌ๊ธฐ์ฌ์ ๊ณต์
- ๋ค์ด๋๋ฏน ํ๋ก๊ทธ๋๋ฐ
- DST zeroshot learning
- ๊ฒ์์์ง
- ๋ฐฑ์ค
- classification text
- Today
- Total
๐ฒ์๋ผ๋๋์ฒญ๋
[์ฅ๊ณ ] ์ฒซ ๋ฒ์งธ ์ฅ๊ณ ์ฑ ์์ฑํ๊ธฐ 3(view + ํ ํ๋ฆฟ + url) ๋ณธ๋ฌธ
[์ฅ๊ณ ] ์ฒซ ๋ฒ์งธ ์ฅ๊ณ ์ฑ ์์ฑํ๊ธฐ 3(view + ํ ํ๋ฆฟ + url)
JihyunLee 2019. 9. 17. 16:19https://docs.djangoproject.com/ko/2.2/intro/tutorial03/
์ฒซ ๋ฒ์งธ ์ฅ๊ณ ์ฑ ์์ฑํ๊ธฐ, part 3 | Django ๋ฌธ์ | Django
Django The web framework for perfectionists with deadlines. Overview Download Documentation News Community Code Issues About ♥ Donate
docs.djangoproject.com
๋ทฐ + ํ ํ๋ฆฟ + url + ์๋ฌ์ฒ๋ฆฌ
ํํ ๋ฆฌ์ผ์ .. ์ฒ์๋ถํฐ ๊ฐ์ฅ ์ข์ ๋ฐฉ๋ฒ์ ์๋ ค์ฃผ์ง ์๊ณ , ์ด๋ณด์๋ฅผ ์ํด ์ฐจ๊ทผ์ฐจ๊ทผ ์ฝ์ง๋ง.. ๋์๊ฐ๋ ๋ฐฉ๋ฒ์ผ๋ก ์๋ ค์ฃผ์ด์ ๋๋ ์ฌ๊ธฐ์ ์ ๋ฆฌ๋ ์ฝ๋๋ฅผ ์ฌ๋ฆฌ๊ฒ ๋ค.
1. polls/url.py
์ ํํ ๋ฆฌ์ผ์์ ๋ง๋ ์ง๋ฌธ - ์๋ต(์ฌ๋ฌ๊ฐ) ์ธํธ๋ฅผ ๋ณด์ฌ์ฃผ๋ ํ๋ฉด์ ๊ตฌ์ฑํด์ผํ๋๋ฐ ๊ฐ์ฅ ๋จผ์ url์ ์ค์ ํด์ค๋ค.
(์ฌ์ค ์์๋ ์๊ด์๋ค)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
from django.urls import path
from . import views
app_name = 'polls'
urlpatterns = [
# ex: /polls/
path('', views.index, name='index'),
# ex: /polls/5/
path('<int:question_id>/', views.detail, name='detail'),
# ex: /polls/5/results/
path('<int:question_id>/results/', views.results, name='results'),
# ex: /polls/5/vote/
path('<int:question_id>/vote/', views.vote, name='vote'),
]
|
cs |
์์ ๊ฐ์ด urls.py ๋ฅผ ์์ ํด ์ฃผ๋ฉด ๋๋๋ฐ, ์ฃผ์์ ์ ์ค๋ช ๋ ๋๋ก, <int:question_id> ์ ๋ถ๋ถ์ ํ๋ผ๋ฏธํฐ๋ก ๋ฐ์์ค๋ ์ซ์๋ฅผ ๋ํ๋ธ๋ค. ๊ทธ๋ฆฌ๊ณ path์ ์๋ name์ด ์๋๋ฐ ์ด name์ ์ด์ฉํด์ view์ ํจ์๋ค๊ณผ ์ฐ๊ฒฐ ํ ์ ์๋ค.
2. polls/views.py
404 ์๋ฌ์ฒ๋ฆฌ, Questionํ ์ด๋ธ์์ key๊ฐ์ ์ด์ฉํด์ ์ ๋ณด ๊ฐ์ ธ์ค๊ธฐ, ๊ทธ๋ฆฌ๊ณ ์ด๋ฅผ renderingํด์ฃผ๋ ์ฝ๋์ด๋ค.
'polls/detail.html' ์ {question: question} ์ ๋ณด๋ฅผ ์ ์กํด์, ํ ํ๋ฆฟ ์์ ์ ๋ณด๊ฐ ๋ณด์ฌ์ง๊ฒ ํ๋ค.
1
2
3
4
5
6
7
|
from django.shortcuts import get_object_or_404, render
from .models import Question
# ...
def detail(request, question_id):
question = get_object_or_404(Question, pk=question_id)
return render(request, 'polls/detail.html', {'question': question})
|
cs |
3. polls/templates/polls/detail.html
์๊น ๋ฐ์์จ ์ ๋ณด๋ฅผ html๋ก ๊พธ๋ฉฐ์ฃผ๋ฉด, ํ๋ฉด์ ์ฌ์ฉ์๊ฐ ์ฝ๊ธฐ ์ฝ๊ฒ ๋ณด์ฌ์ง๋ค.
1
2
3
4
5
6
|
<h1>{{ question.question_text }}</h1>
<ul>
{% for choice in question.choice_set.all %}
<li>{{ choice.choice_text }}</li>
{% endfor %}
</ul>
|
cs |
'django' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[์ฅ๊ณ ] ์ฒซ ๋ฒ์งธ ์ฅ๊ณ ์ฑ ์์ฑํ๊ธฐ4(์ ๋๋ฆญ ๋ทฐ) (0) | 2019.09.17 |
---|---|
[์ฅ๊ณ ] ์ฒซ๋ฒ์งธ ์ฅ๊ณ ์ฑ ์์ฑํ๊ธฐ 2-1(๊ด๋ฆฌ์ ์๋ฒ) (0) | 2019.09.17 |
[์ฅ๊ณ ] ์ฒซ ๋ฒ์งธ ์ฅ๊ณ ์ฑ ์์ฑํ๊ธฐ ํํ ๋ฆฌ์ผ 2-1 (0) | 2019.09.17 |
[์ฅ๊ณ ] ์ฒซ ๋ฒ์งธ ์ฅ๊ณ ์ฑ ์์ฑํ๊ธฐ ํํ ๋ฆฌ์ผ 1 (0) | 2019.09.17 |