본문 바로가기

Project/flask app 통신

[flask app 통신] post.html을 만들어보자

728x90

[flask app 통신] app.py를 만들어보자에서 사용하였던 render_template('post.html')의 post.html을 만들어보겠습니다.

 

post.html은 이름을 작성할 수 있는 간단한 폼으로 구성되어 있습니다.

 

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <form action="/post" method="post">
        <p>이름 : <input type="text" value=""></p>
        <input type="submit" value="제출하기">
    </form>
</body>
</html>

 

이름을 입력할 수 있게 input type='text'로 지정해주고, /post 경로로 정보를 보낼 수 있는 제출 버튼 input type='submit'도 만들어준다.

728x90