Coder Social home page Coder Social logo

flask-qr-code's Introduction

TOY APP

This is a bare bones toy web server that I made when playing through an imaginary scenario.

The Scenario

You have an inventory to manage, and want to scan QR codes to manage inventory. You want to encode the product number in the QR code, so that you scan, optionally type a quantity (default to 1), and get prompted by a page indicating success.

What this code does:

This code doesn't do anything to a database or file (this can easily be added). All it does is present two different html pages. One is used to submit the product quantity, and another is used to present a confirmation page. This makes use of HTTP calls to send data (qty, product number, checkin vs checkout) from the web page to the server. Before serving up the html page to the browser, flask uses Jinja2 templating to insert values into the html before displaying it back to the user see the files under the /templates directory.

Tech

Python 3.7 Flask 1.0.3 (see requirements.txt for more details)

QR

QR Codes can be used to encode many different types of data. The example here is that a QR code is encoded with a product id and a "direction", either in or out. When the code is scanned (using a modern smartphone), a browser is opened to the URL encoded in the QR code. The browser in our example points to http://0.0.0.0:5000/?pn=70&io=out, which tells the server that pn (product number) 70 is getting taken out.

Testing & Requirements

This was tested localy and worked both in the browser on my local linux machine (Fedora 30), and using a QR App on my smartphone while connected to the same wifi network and with the correct firewall permissions applied on my desktop. Obviously the bash start.sh (which is just the flask start command) script requires bash, but every other tool used in this project should be cross platform to the best of my knowledge. Install python3.7 and use pip to install Flask and you should be good to go.

Disclaimer:

This is NOT an example of quality or organizaed code by any means. This is a hack job, proof of concept, toy that might possible have some value to some individual (most likely my future self).

flask-qr-code's People

Contributors

holmanb avatar

Watchers

 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.