Giter Site home page Giter Site logo

login-session-lab's Introduction

Let's build a quoteboard!

Today, we are building a web app that stores and displays quotes that a user inputs.

In our project folder, we have a 'static' folder where you can add css files, and a 'templates' folder where you'll find all of our templates (html files) that we are/will be using.

In today's lab, you'll only work with and edit one main Python file and 2 templates: home.html and display.html. Flask session has already been imported in the main Python file.

First things first, fork this repo(sitory) and clone it to your desktop!

Part 1: Home

  1. Add a form to home.html! Take in a quote, the quote's author, and the author's age.

  2. When the form is submitted, store the form's information in login_session, example: login_session['age'] = age.

  3. Display thanks.html if the form's information is successfully submitted and stored.

  4. Use try and except to handle errors with storing the form responses in the login session. If there is an error, users should be redirected to error.html.

Part 2: Display Page

  1. Fill in display.html with a template to display a quote, author, and age.

  2. Pass information from login_session to display.html.

  3. Check to make sure the display page will now correctly display the quote that a user enters.

Bonus:

  • Add a button to the display page to take in additional quotes
  • Modify the display.html template to loop through a list of submitted quotes and display all of them.
  • Use CSS to make your quoteboard look like an actual whiteboard!

login-session-lab's People

Contributors

fouadhadd avatar

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.