D
D
Dmitry2020-11-06 09:33:19
Django
Dmitry, 2020-11-06 09:33:19

How to parse a request like this in Django 3: https://some domain/category.php?cat={number}?

There is a site written in php and url address like https://some domain/category.php?cat={number}. I need to specify the path in django 3 in urls.py so that without breaking the old url category.php?cat={number} get the value cat.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Gornostaev, 2020-11-06
@Dim4Nik

urls.py views.py
path('category.php', your_view)

def your_view(request):
    cat = request.GET['cat']
    ...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question