无法导入名称HttpRespons

2024-04-23 20:15:56 发布

您现在位置:Python中文网/ 问答频道 /正文

视图.py

from django import HttpResponse

def hello(request):
    return HttpResponse("Hello world ! ")

Request Method: GET
Request URL:    http://127.0.0.1:8000/hello/
Django Version: 1.3.1
Exception Type: ImportError
Exception Value:    
cannot import name HttpResponse

Tags: djangofrompyimport视图helloworldreturn