0
0 комментариев

Ребят начал изучать Falcon, но при запуске страници возникла проблема,подскажите пожалуйста что я делаю не так!

Логи:

(venv) user@hameleon:~/lessons/api$ http localhost:8000/quote
http: error: ConnectionError: HTTPConnectionPool(host='localhost', port=8000): Max retries exceeded with url: /quote (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused',)) while doing GET request to URL: http://localhost:8000/quote

[/apcode]

Код:

    import falcon
 
 
    class QuoteResource:
        def on_get(self, req, resp):
            """Handles GET requests"""
            resp.status = falcon.HTTP_200
            resp.body = ('I\'ve always been more interested in the future than in the past.')
 
    app = api = falcon.API()
 
    quotes = QuoteResource()
 
    api.add_route('/quote', quotes)


Добавить комментарий