Creating A simple web application (1)

Use Python, Flask and MySQL to create a simple web application where users can register, sign in and create their bucket list.

Setting Up Flask

Setting up Flask is pretty simple and quick. With pip package manager, all we need to do is:

  • Install flask
pip install flask
  • Create a file called app.py. Import the flask module and create an app using Flask as shown:
from flask import Flask
app = Flask(__name__)
@app.route("/")
def main():
    return "Welcome!"
if __name__ == "__main__":
    app.run()

Save the changes and execute app.py:

python app.py

Point your browser to http://localhost:5000/ and you should have the welcome message.

H2
H3
H4
3 columns
2 columns
1 column
Join the conversation now
Logo
Center