import json
rtnmsg = "완료"
context = {'state': True, 'rtnmsg': rtnmsg}
return HttpResponse(json.dumps(context, ensure_ascii=False), content_type="application/json")
또는 때에 따라서
rtnmsg = "완료"
context = {'state': True, 'rtnmsg': rtnmsg}
return HttpResponse(json.dumps(context, ensure_ascii=False))
'Python' 카테고리의 다른 글
| python 정규식 (0) | 2019.10.29 |
|---|---|
| python 날짜 (0) | 2019.10.29 |
| django datetimefield 옵션 (0) | 2019.10.25 |
| txt 파일에 로그 남기기 (0) | 2019.10.25 |
| django 를 api 서버로 활용시 CSRF 이슈 (POST 전송) (0) | 2019.10.24 |