Print POST Data
In any web app, you’ll have to process incoming request data from users. Flask, like any other web framework, allows you to access the request data easily.
Next step is going to be to make use of the value:
from flask import Flask from flask import render_template app = Flask(__name__) @app.route("/"), methods=['GET', 'POST'] def index (): if request.method == 'POST': enteredCoin = request.form['cointype'] return render_template("index.html", data=process_data.process(), enteredCoin=enteredCoin()) elif request.method == 'GET': return render_template("index.html", data=process_data.process(), process_coin=process_data.process_coin()) if __name__ == "__main__": app.run(debug=True)
Update Panels
Easily add a heading container to your panel with .panel-heading
. You may also include any <h1>
–<h6>
with a .panel-title
class to add a pre-styled heading. However, the font sizes of <h1>
–<h6>
are overridden by .panel-heading
.
For proper link coloring, be sure to place links in headings within .panel-title
.
Wrap buttons or secondary text in .panel-footer
. Note that panel footers do not inherit colors and borders when using contextual variations as they are not meant to be in the foreground.
Extra formatting
Let’s make some small formatting changes, that will make our app a little bit nicer.
Open your “index.html” and let’s put some Dollar and percentage signs to the coin price and change:
The result is that we have some Dollar and percentage signs where we want: