It is not possible to write front-end course every time user make changes in his/her profile. We use a template and it generates code according to the content.
Flask is one of the web development frameworks written in Python. Through flask, a loop can be run in the HTML code using jinja template and automatically HTML code can be generated using this.
The code will be stored in Directories in the format of Flask. So we will be making two directories,
- static – For static Files like images, css, js
- templates – For Html templates
app.py file which will contain all the Python file will be stored in the main directory and index.html file will be stored in templates.
The code of app.py is same for both examples. We will print a Python list with Some names of Pokemons first in the format of a list
and then a table.
Example #1: Making a List
We will use the argument Pokemons passed from python file here to automatically print a list instead of Writing it everytime.
Without writing any data of list, the list will be automatically generated. You can use the css and js to make these look beautiful.
Example #2: Making a Table
We will use the argument Pokemons passed from python file here to automatically print a table instead of Writing it our self. Code for app.py for this example is same as the above one.
Without writing any data of list, the table will be automatically generated.
Instructions to Run code:
- Download the files from link provided above or make and store the code in the same format
- Run the app.py file in root directory
- Go to the local host ( http://127.0.0.1:5000/ in my case) and there you have the website
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course.
- Python | Introduction to Web development using Flask
- Python | Build a REST API using Flask
- Create a Weather app using Flask | Python
- Todo list app using Flask | Python
- Profile Application using Python Flask and MySQL
- Setup API for GeeksforGeeks user data using WebScraping and Flask
- Deploy Machine Learning Model using Flask
- Sending Emails Using API in Flask-Mail
- Using JWT for user authentication in Flask
- Retrieving HTML From data using Flask
- Login and Registration Project Using Flask and MySQL
- Deploy Python Flask App on Heroku
- Subdomain in Flask | Python
- Flask - (Creating first simple application)
- Dockerize your Flask App
- Deploying a TensorFlow 2.1 CNN model on the web with Flask
- Setting up Google Cloud SQL with Flask
- Template Inheritance in Flask
- Handling 404 Error in Flask
- Differences Between Django vs Flask
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.