Only a small difference is recorded here
path('/abc/<int:id>/', views.abc, name='abc')
This needs to be passed id For the corresponding view
def abc(request, id):
pass
*** In this function abc Inside ,id It can be used directly ***, Don't need to use GET.get, perhaps POST.get Way to obtain , Just use it directly
reception HTML It is written in :
Such as : <a href="{% url 'bee:index_bee' bee.id %}">{
{
bee.name }}</a>
Be careful url The command is followed by the function to be executed , Then there is the parameter ,
How to query strings
You don't have to be here path It's equipped with , But it needs to be used in the view function POST.get, perhaps GET.get To get the passed parameters
path('abc/', views.abc, name='abc')
def abc(request):
id = request.GET.get('id') This one at the back 'id' It's on the front end HTML Page corresponding
...
The front desk HTML The page also needs to put that id Pass it to the backstage
<input name='id'>