In this repository, you will learn:
- How to create and activate a virtual environment
- How to extract dependencies in a virtual environment
- How to create a simple Flask app
- How to send and receive data between a client and a Flask server
- How to process data and return a response
- How to use Jinja templating for dynamic web pages
Follow these steps to create your own repository from this template and set it up locally.
- Click on the "Use this template" button at the top of this repository on GitHub.
- Choose Create a new repository.
- Name it something like
python-flask-basics. - Set the repository visibility to public.
- Click Create repository from template.
Once your repository has been created from the template, clone it to your local machine:
git clone https://github.com/YOUR_GITHUB_USERNAME/python-flask-basics.gitReplace YOUR_GITHUB_USERNAME with your actual GitHub username.
Move into the project folder:
cd python-flask-basicspython -m venv venv
venv\Scripts\activatepython3 -m venv venv
source venv/bin/activateOnce inside the virtual environment, install the required dependencies:
pip install -r requirements.txtRun the following command to start the Flask server:
python app.pyBy default, Flask will run on http://127.0.0.1:5000/. Open this URL in your browser to check if the app is working.
| No. | Topic | Description |
|---|---|---|
| 1 | Using Virtual Environment | Learn how to create and activate a virtual environment. |
| 2 | Pip Freeze | Extract dependencies using pip freeze and save them to requirements.txt. |
| 3 | Flask Basics - GET Request | Build a simple Flask app that handles a GET request and returns a basic response. |
| 4 | Flask Basics - POST Request | Create a Flask API that processes POST requests and returns a JSON response. |
- Follow the instructions in each assignment folder and complete the exercises.
- Push your completed work to your GitHub repository and submit the link via Google Classroom.
Enjoy learning Flask and building awesome projects! 🚀🐍
.,,uod8B8bou,,.
..,uod8BBBBBBBBBBBBBBBBRPFT?l!i:.
,=m8BBBBBBBBBBBBBBBRPFT?!||||||||||||||
!...:!TVBBBRPFT||||||||||!!^^""' ||||
!.......:!?|||||!!^^""' ||||
!.........|||| ||||
!.........|||| ## |||| GDG - PUP
!.........|||| ||||
!.........|||| ||||
!.........|||| ||||
!.........|||| ||||
`.........|||| ,||||
.;.......|||| _.-!!|||||
.,uodWBBBBb.....|||| _.-!!|||||||||!:'
!YBBBBBBBBBBBBBBb..!|||:..-!!|||||||!iof68BBBBBb....
!..YBBBBBBBBBBBBBBb!!||||||||!iof68BBBBBBRPFT?!:: `.
!....YBBBBBBBBBBBBBBbaaitf68BBBBBBRPFT?!::::::::: `.
!......YBBBBBBBBBBBBBBBBBBBRPFT?!::::::;:!^"`;::: `.
!........YBBBBBBBBBBRPFT?!::::::::::^''...::::::; iBBbo.
`..........YBRPFT?!::::::::::::::::::::::::;iof68bo. WBBBBbo.
`..........:::::::::::::::::::::::;iof688888888888b. `YBBBP^'
`........::::::::::::::::;iof688888888888888888888b. `
`......:::::::::;iof688888888888888888888888888888b.
`....:::;iof688888888888888888888888888888888899fT!
`..::!8888888888888888888888888888888899fT|!^"'
`' !!988888888888888888888888899fT|!^"'
`!!8888888888888888899fT|!^"'
`!988888888899fT|!^"'
`!9899fT|!^"'
`!^"'