在django项目中出现如图所示错误:
很有可能是我们在view模块中根本没有导入django.http 的内置模块
解决方式如下,在我们视图模块导入:
from django.http import HttpResponse
NameError at / name ‘HttpResponse‘ is not defined(Django)
最新推荐文章于 2024-02-19 02:15:00 发布
在django项目中出现如图所示错误:
很有可能是我们在view模块中根本没有导入django.http 的内置模块
解决方式如下,在我们视图模块导入:
from django.http import HttpResponse