You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fromdjango.httpimportHttpResponse# HttpResponse is how we sendimportjson# Converts to jsondef [function](request):
# Not actually JSON in this form!some_json= {
'var1': 'foo',
'var2': 'bar',
}
# Conversiondata=json.dumps(some_json)
# Return JSON and let it know its jsonreturnHttpResponse(data, content_type='application/json')