Git Product home page Git Product logo

section-week-13's Introduction

Goals

  • Flask and Jinja Template
    • Let's create a basic UI for a search box!
  • Start your final project

Part 1

  • Make sure you have the packages in requirements.txt installed
  • Run app.py
  • Open browser to http://localhost:5000, and add /q?=University of Michigan to the location
  • Edit app.py and write code in index() function to get answer and result values
    • You will need to extract the value of q found in the location bar of your browser using Flask using: request.args.get('q'). request is different from requests library. request is current request that Flask receives from your browser, while requests library helps you make requests to external websites / API.
  • Look at templates/index.html. Can you understand what is happening in the file?
  • Instead of typing the query in the browser's address bar every time, let us make an input field that takes the question and shows the result in the same page.
    • Add a form that has an input with name="q"
      <form action="/" method="GET">
          <label>
              <b>Ask the Duck</b>
              <input name="q" type="text" placeholder="Start typing..." />
          </label>
          <button type="submit">Send</button>
      </form>
      

Part 2: Start your final project

  • Write code to get data from your API / Website
  • Use "dummy data" and create a visualization

section-week-13's People

Contributors

anandpdoshi avatar

Watchers

James Cloos 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.