Django
- 1 ответ
- 0 вопросов
0
Вклад в тег
urlpatterns = [
path('articles/<int:year>/<int:month>/<int:day>/', views.day_archive, name='day_archive'),
...
]
def ...
year = request.POST.get("year")
month = request.POST.get("month")
day = request.POST.get("day")
return HttpResponseRedirect('articles/' + year + '/' + month + '/' + day + '/')
from django.urls import reverse
def ...
year = request.POST.get("year")
month = request.POST.get("month")
day = request.POST.get("day")
return HttpResponseRedirect(reverse('day_archive', args=[year, month, day]))