Страницы

Поиск по вопросам

воскресенье, 29 марта 2020 г.

socket.gaierror: [Errno 11001] getaddrinfo failed

#python #flask


Начал изучать Flask и на первом же уроке у меня поплыли ошибки:)

Ниже код:

from flask import Flask

app = Flask(__name__)


@app.route('/')
def index():
    return 'this is a Flask'


app.run('127.0.0.1:8200', debug=True)


Логи:

C:\Users\gibki\AppData\Local\Programs\Python\Python37\python.exe C:/Users/gibki/PycharmProjects/image-similarity-deep-ranking1/app.py
 * Serving Flask app "app" (lazy loading)
 * Environment: production
   WARNING: This is a development server. Do not use it in a production deployment.
   Use a production WSGI server instead.
 * Debug mode: on
Traceback (most recent call last):
  File "C:/Users/gibki/PycharmProjects/image-similarity-deep-ranking1/app.py", line
11, in 
    app.run('127.0.0.1:8200', debug=True)
  File "C:\Users\gibki\AppData\Roaming\Python\Python37\site-packages\flask\app.py",
line 944, in run
    run_simple(host, port, self, **options)
  File "C:\Users\gibki\AppData\Roaming\Python\Python37\site-packages\werkzeug\serving.py",
line 987, in run_simple
    s.bind(server_address)
socket.gaierror: [Errno 11001] getaddrinfo failed

    


Ответы

Ответ 1



app.run('127.0.0.1', port=8200, debug=True)

Комментариев нет:

Отправить комментарий