2,619
次編輯
Tankianting(討論 | 貢獻) |
Tankianting(討論 | 貢獻) |
||
行 27: | 行 27: | ||
<pre> | <pre> | ||
from django.http import Http404, | from django.http import Http404, HttpResponse | ||
from . import config # import the config variables in the file './config.py'. | from . import config # import the config variables in the file './config.py'. | ||
行 42: | 行 42: | ||
raise Http404() # throw 404 | raise Http404() # throw 404 | ||
else: | else: | ||
return | # return json file with setting content_type | ||
return HttpResponse(json.dumps(user_json), content_type="application/activity+json") | |||
</pre> | </pre> | ||