python - django cannot get front-end parameters?
过去多啦不再A梦
过去多啦不再A梦 2017-06-22 11:51:28
0
1
959

Parameters passed from the front end:

The back-end code obtains parameters for query:

def download_workorder(request):
    # 组装excel表格
    if request.method == 'GET':
        phone = request.GET.get('phone',None)
        iden_num = request.GET.get('iden_num',None)
        status = request.GET.get('status','2000')

        print(phone,iden_num,status)
     


#status The data sent from the front end is not obtained, and it is still the default value. I'd like to ask what could be the reason?

The above is the value passed by ajax from the front-end colleague, but it was not obtained.

The following is what I directly pieced together to access in the browser:

http://127.0.0.1:8000/workorders/download?status=2001&phone=13122001480&iden_num=9915

The URL results obtained the parameters, printed request.GET, and successfully downloaded the form

I would like to ask, is it possible that the data was lost when we transferred it to the front and back ends?

过去多啦不再A梦
过去多啦不再A梦

reply all(1)
某草草

Why do I see something wrong with the question mark in your URL? Are you sure it is an English question mark?

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template