eman19-meet / y2l-flask-routing-lab

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Y2 2018 Yearlong: Flask routing

Before you start: Fork and clone this repository

  1. Fork this repository by clicking "Fork" on this page: forking

  2. Copy this repository's url by clicking the green clone button: copying url

Part 1: Setting up Flask

Edit app.py for this portion of the lab.
This lab is the beginning of a project that we'll be building on top of every session to help practice Python, Flask and Databases..So make sure to save your code!.
In this project you'll be creating an online shop of your choice!

  1. Create a basic html file in the "templates" folder, call it "home.html", this page is responsible for showing the products to the user.

  2. Go to app.py and connect the html file you just created to flask. Test it out and call us to check! (Reminder: to see your page you should run app.py by typing "python app.py" in the terminal, then open the link that you get)

Bonus

  1. Design the "shop.html" using css and bootstrap.

  2. Add a navbar. (Use w3schools.com for help if needed)

Part 2: Routing

Create a new app route "/shop", and link it to the shop.html template from the previous part.

Bonus

Connect shop.html and home.html together using buttons or navbars (Hint: Google "url_for")

Part 3: Style Your Home Page

Create a list of product names and pass it to the shop.html template, have all product names show up in the shop template in order. You can make it as a basic list using div and/or br tags, in a bootstrap grid system, or even in a more advanced styling from the web. Your call, be creative!

Bonus

  1. Add prices assigned to each product and show them on shop.html accordingly. (You can do this in many ways, google it!)

  2. Start creating a basic template of a product page.

About


Languages

Language:HTML 88.7%Language:Python 10.2%Language:CSS 1.0%