经过几次试验,我还是得到了同样的结果
ImportError: cannot import name 'HTTpResponse' from 'django.http' (/Users/mac/my_env/lib/python3.7/site-packages/django/http/__init__.py) after running '$ python manage.py runserver'
在航站楼里。有没有人能给我讲讲这个问题?谢谢!
下面的代码最初取自Django官方网站上的Django教程。
from django.shortcuts import render
from django.http import HTTpResponse
def index(request):
return HTTpResponse("Hello, world. You're at the polls index.")
发布于 2020-04-06 13:58:40
如果你在views.py中使用(Httpresponse)(django=3.0.5python= 3.8.2)
试试这个:
from django.shortcuts import HttpResponse
(确保它在骆驼的情况下)希望这会有所帮助
发布于 2019-10-05 03:28:33
试试这个:
from django.http import HttpResponse
随机大写的原因是什么?
发布于 2020-04-20 21:52:24
试试这个:
from django.shortcuts import render
from django.http import HttpResponse
def index(request):
return HttpResponse("Hello, world. You're at the polls index.")
Python是一种区分大小写的语言,在这里使用camelCase并遵循下面的代码。我认为,它会工作的
https://stackoverflow.com/questions/58241664
复制相似问题