Skip to content

Commit

Permalink
feat: added starter form submission
Browse files Browse the repository at this point in the history
  • Loading branch information
l0rtk committed Dec 17, 2021
1 parent d53f658 commit e4c4312
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
8 changes: 6 additions & 2 deletions app.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
from flask import Flask,render_template
from flask import Flask,render_template,url_for,request

app = Flask(__name__)

@app.route("/")
@app.route("/",methods=["GET","POST"])
def index():
if request.method == "POST":
keywords = request.form["keywords"].split(",")
websites = request.form["websites"].split(",")

return render_template("starter.html")


Expand Down
2 changes: 1 addition & 1 deletion templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

<title>Hello, world!</title>
</head>
<body>
<body class="bg-dark">
<div class="container">

{% block content %}{% endblock %}
Expand Down
6 changes: 3 additions & 3 deletions templates/starter.html
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{% extends 'base.html' %}

{% block content %}
<form class="mt-5">
<form class="mt-5" action="#" method="POST">
<div class="form-group">
<label for="exampleInputEmail1">Enter Keywords</label>
<input type="text" class="form-control" id="keywordsInput" aria-describedby="keywordsInput" placeholder="Input keywords with ,(comma) separator">
<input type="text" name="keywords" class="form-control" id="keywordsInput" aria-describedby="keywordsInput" placeholder="Keywords with , separator (e.g messi,ronaldo)">
</div>
<div class="form-group mt-4">
<label for="exampleInputPassword1">Websites</label>
<input type="text" class="form-control" id="exampleInputPassword1" placeholder="Input websites with ,(comma) separator">
<input type="text" name="websites" class="form-control" id="exampleInputPassword1" placeholder="Websites with , separator">
</div>
<button type="submit" class="btn btn-primary mt-3">Submit</button>
</form>
Expand Down

0 comments on commit e4c4312

Please sign in to comment.