Skip to content

itmo-wad/HM1-Badr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Flask Profile Project

This project demonstrates two ways of serving a personal profile page with Flask:

  1. Basic Approach:

    • Uses basic.py to serve a single HTML file (basic.html) via send_from_directory.
    • No dynamic parameters or redirects.
  2. Advanced Approach:

    • Uses advanced.py with Flask’s render_template to serve advanced.html.
    • Redirects from / to /profile and injects parameters (name, description) into the template.

Project Summary

  • We created two Python files (basic.py and advanced.py) to showcase both simple and more advanced serving methods in Flask.
  • We built two HTML pages (basic.html and advanced.html), each demonstrating a different approach.
  • A requirements.txt file is included to specify the dependencies needed for this project (primarily Flask).
  • We also included a static/ folder containing CSS and image files.

How to Run

  1. Clone the Repository:

    git clone <repo url>
    cd <repo-name>
    
    
  2. install Dependancies

    pip install -r requirements.txt
    
    
  3. run the basic version

    python basic.py
    
    
  4. run the advanced version

    python advanced.py
    
    

Go to http://127.0.0.1:5000/. You’ll be redirected to /profile, where you’ll see the Advanced page with dynamic parameters.

folder structure.

.
├── basic.py
├── advance.py
├── requirements.txt
├── static
│   ├── style.css
│   └── me.jpg
└── templates
    ├── basic.html
    └── advance.html

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors