1seok2

add flask post

No preview for this file type
1 node_modules 1 node_modules
2 .env 2 .env
3 .vscode 3 .vscode
4 +chromedriver
4 5
5 -key.py
...\ No newline at end of file ...\ No newline at end of file
6 +key.py
......
1 import os 1 import os
2 from config.firebase import db 2 from config.firebase import db
3 -from flask import Flask, render_template 3 +from flask import Flask, render_template, request
4 4
5 # data = { 5 # data = {
6 # "age": 24, 6 # "age": 24,
...@@ -23,6 +23,12 @@ def home(): ...@@ -23,6 +23,12 @@ def home():
23 return render_template('index.html') 23 return render_template('index.html')
24 24
25 25
26 +@app.route("/check", methods=["POST"])
27 +def check():
28 + value = request.form['insta_id']
29 + return value
30 +
31 +
26 if __name__ == "__main__": 32 if __name__ == "__main__":
27 print("-" * 60) 33 print("-" * 60)
28 print(" server is start") 34 print(" server is start")
......
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 +<head>
4 + <title>check insta</title>
5 +</head>
3 <body> 6 <body>
4 <h1>메인 화면</h1> 7 <h1>메인 화면</h1>
8 + <form action="/check" method="POST">
9 + <input id="insta_id" placeholder="id" type="text" name="insta_id"/>
10 + <button>제출</button>
11 + </form>
5 </body> 12 </body>
6 </html> 13 </html>
...\ No newline at end of file ...\ No newline at end of file
......