diff --git a/tips/constants.py b/tips/constants.py index 21dc598a..5150a6a2 100644 --- a/tips/constants.py +++ b/tips/constants.py @@ -1,3 +1,5 @@ TIPS_PAGE_ROUTE = 'tips/index.html' ADD_TIP_PAGE_ROUTE = 'tips/add_tip.html' EDIT_TIP_PAGE_ROUTE = 'tips/edit_tip.html' +READ_MORE_PAGE_ROUTE = 'tips/read_more.html' +CATEGORIES_PAGE_ROUT = 'tips/categories.html' diff --git a/tips/templates/tips/read_more.html b/tips/templates/tips/read_more.html index 73184686..5a347e70 100644 --- a/tips/templates/tips/read_more.html +++ b/tips/templates/tips/read_more.html @@ -36,4 +36,4 @@

{{ tip.author }}

-{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/tips/views.py b/tips/views.py index 9160342d..4b20c760 100644 --- a/tips/views.py +++ b/tips/views.py @@ -1,7 +1,7 @@ from django.shortcuts import render, redirect, get_object_or_404 from .models import Tip from .forms import TipForm -from .constants import TIPS_PAGE_ROUTE, ADD_TIP_PAGE_ROUTE, EDIT_TIP_PAGE_ROUTE +from .constants import TIPS_PAGE_ROUTE, ADD_TIP_PAGE_ROUTE, EDIT_TIP_PAGE_ROUTE, READ_MORE_PAGE_ROUTE, CATEGORIES_PAGE_ROUT def board(request): @@ -22,12 +22,12 @@ def add_tip(request): def categories_filter(request, cats): category_filtered_tips = Tip.objects.filter(category=cats) - return render(request, 'tips/categories.html', {'cats': cats, 'category_filtered_tips': category_filtered_tips}) + return render(request, CATEGORIES_PAGE_ROUT, {'cats': cats, 'category_filtered_tips': category_filtered_tips}) def read_more_view(request, tip_id): tip = get_object_or_404(Tip, pk=tip_id) - return render(request, 'tips/read_more.html', {'tip': tip}) + return render(request, READ_MORE_PAGE_ROUTE, {'tip': tip}) def edit_tip(request, tip_id):