CBSE Class 12 Computer Science(083) Python Project Flask: Flask is a micro web framework written in Python. It is classified as a microframework because it does not require particular tools or libraries. Flask is a lightweight WSGI web application framework. It is designed to make getting started quick and easy, with the ability to scale up to complex applications.
Follow the below steps to create a simple website using Flask
- Create an app.py file and copy-paste the #app.py code there.
- Create two folders named templates and a static folder. Those folders should be in the same directory with your app.py file.
- Create four files inside the templates folder, layout.html, home.html, about.html , and main.css and copy-paste the code of #layout.html, #home.html, #about.html and #main.css in those files, respectively.
- Execute app.py in pycharm
- Visit localhost:5000(http://127.0.0.1:5000/) on your browser to see the website.
- If you get an error make sure you created the correct directory structure as explained in steps 1 to 3 It should be: templates/ layout.html home.html about.html main.css static/ photo.jpg slides.gif app.py