~/Desktop$ pip uninstall django DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support Found existing installation: Django 1.8.16 Uninstalling Django-1.8.16: Would remove: /Users/lowbee/Library/Python/2.7/bin/django-admin /Users/lowbee/Library/Python/2.7/bin/django-admin.py /Users/lowbee/Library/Python/2.7/lib/python/site-packages/Django-1.8.16.dist-info/* /Users/lowbee/Library/Python/2.7/lib/python/site-packages/django/* Proceed (y/n)? n
from django.shortcuts import render from django.http import JsonResponse
# Create your views here. defhello(request): if request.method =="GET": return render(request,"hello.html") elif request.method =="POST": name = request.POST.get("name") print name ret = {"result":"success"} return JsonResponse(ret)