Getting 'str' object has no attribute 'get' in Django

前端 未结 2 1491
春和景丽
春和景丽 2020-12-15 16:00

views.py

def generate_xml(request, number):
    caller_id = \'x-x-x-x\'
    resp = twilio.twiml.Response()

    with resp.dial(callerId=caller_id) as r:
             


        
2条回答
  •  温柔的废话
    2020-12-15 16:24

    You can not pass directly str as a django response . You must use

    from django.http import HttpResponse
    

    if you want to render string data as django view response. have a look here

    return HttpResponse(resp)
    

提交回复
热议问题