2011-10-21 3 views
6

views.py이름 HttpResponse에 가져올 수 없습니다

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 

답변

18

당신이 시도 할 수 있습니다 : from django.http import HttpResponse

+0

괜찮습니다! 감사 ! – fuhao715

2

을 당신은 잘못된 위치에서 가져

django.http이 올바른 위치 from django.http import HttpResponse

입니다
관련 문제