Introduction To Flask and Web Development
Introduction To Flask and Web Development
Web Development
Building your first web application with Python!
Objectives of this Module:
Requirements:
Install Python (latest version).
Install Flask using pip (pip install flask)
Create a virtual environment (python –m venv venv)
Activate the environment and install dependencies.
Tip: Always use a virtual environment to manage dependencies.
Writing Your First Flask App
Steps:
Open a terminal and navigate to the project folder.
Activate the virtual environment.
Run the script using python app.py.
Open http://127.0.0.1:5000 in a browser.
Tip: Use flask run as an alternative command.
Understanding Routes and Views
Key Takeaways:
Flask is a lightweight and flexible web framework.
Setting up a Flask project requires Python and pip.
Routes define URLs, and views return responses.
Running app.run(debug=True) starts a local web server.
Next Steps: Learn about Docker and containerizing Flask apps in Module 2.
Introduction to Flask and
Web Development
Building your first web application with Python!