Code Monkey home page Code Monkey logo

y2l-flask-routing-lab's Introduction

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.