ubuntu 14.04
에 python 2.7.6
을 사용하고 있으며 팔콘 웹 프레임 워크에서 간단한 hello world 프로그램을 실행하려고합니다. 그러나이 예제를 실행하는 동안 다음과 같은 오류가 발생합니다. 이것에 대한 어떤 생각?개체에 팔콘의 'API'오류가 없습니다.
코드 :
import falcon
class ThingsResource(object):
def on_get(self, req, resp):
"""Handles GET requests"""
resp.status = falcon.HTTP_200
resp.body = 'Hello world!'
# falcon.API instances are callable WSGI apps
wsgi_app = api = falcon.API()
# Resources are represented by long-lived class instances
things = ThingsResource()
# things will handle all requests to the '/things' URL path
api.add_route('/hello', things)
오류 :
Traceback (most recent call last):
File "falcon.py", line 1, in <module>
import falcon
File "/home/naresh/Desktop/PythonFramework/falcon.py", line 10, in <module>
wsgi_app = api = falcon.API()
AttributeError: 'module' object has no attribute 'API'
파이썬 파일이 바로 falcon.py? – iFlo