• 카테고리

    질문 & 답변
  • 세부 분야

    풀스택

  • 해결 여부

    미해결

게시판 만들기가 안됩니다

21.05.24 18:53 작성 조회수 390

1

from flask import Flask
from flask import request
from flask import render_template

app = Flask(__name__)


@app.route("/route"methods=["GET""POST"])
def board_write():
    if request.method == "POST":
        name=request.form.get("name")
        title = request.form.get("title")
        contents = request.form.get("contents")
    else:
        return render_template("write.html")


if __name__ == "__main__":
    app.run(host="0.0.0.0"debug=Truepost=9000)


* Serving Flask app 'run' (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:\python\myweb\run.py", line 19, in <module> app.run(host="0.0.0.0", debug=True, post=9000) File "C:\python\myweb\venv\lib\site-packages\flask\app.py", line 922, in run run_simple(t.cast(str, host), port, self, **options) TypeError: run_simple() got an unexpected keyword argument 'post'
문제 되는 922 줄 코드
 try:
            run_simple(t.cast(strhost), portself, **options)
        finally:
            # reset the first request information if the development server
            # reset normally.  This makes it possible to restart the server
            # without reloader and that stuff from an interactive shell.
            self._got_first_request = False
이런식으로 되어있더라구여

답변 1

답변을 작성해보세요.

0

app.run(host="0.0.0.0"debug=Truepost=9000)

위에 보시면 post 가 아니라 port 로 쓰셔야.... ^^;;