This is my question and I’m just starting to learn django ^-^
these are urls
from django.urls import path, include
from . import views
urlpatterns = [
path('', views.index),
path('<int:days_week>/', views.get_info_week_intoviy),
path('<str:days_week>/', views.get_info_week, name = 'day-week'),
path('type/', views.teplt, name='types'),
]
def teplt(request, types):
dnay = ['CHETNIY', 'NECHETNIY']
rez = ''
for typess in dnay:
new_ser = reverse('types', args = (typess,))
rez += f'<li><a href="{new_ser}">{typess}</a></li>'
response = f'''
<ol>
{rez}
</ol>
'''
return HttpResponse(response)
this is the part of the code that should output as links along such a path http://127.0.0.1:8000/HOROS/type
CHETNIY
NECHETNIY
I tried to fix the url and view somehow, but all attempts were in vain and returned to the previous code
New contributor
данил is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.