Skip to content

Commit

Permalink
Specify question URLs using the url template function.
Browse files Browse the repository at this point in the history
  • Loading branch information
joshSzep committed Jun 23, 2024
1 parent ec21008 commit 6b82015
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
{% if latest_question_list %}
<ul>
{% for question in latest_question_list %}
<li><a href="/hangul_tutor_app/{{ question.id }}/">{{ question.question_text }}</a></li>
<li>
<a href="{% url 'hangul_tutor_app:detail' question.id %}">
{{ question.question_text }}
</a>
</li>
{% endfor %}
</ul>
{% else %}
Expand Down
1 change: 1 addition & 0 deletions hangul_tutor/hangul_tutor_app/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from hangul_tutor.hangul_tutor_app import views


app_name = "hangul_tutor_app"
urlpatterns = [
path("", views.index, name="index"),
path("<int:question_id>/", views.detail, name="detail"),
Expand Down

0 comments on commit 6b82015

Please sign in to comment.