Giter Site home page Giter Site logo

flask-example's Introduction

flask-example

A minimal web app developed with Flask framework.

The main purpose is to introduce how to implement the essential elements in web application with Flask, including

  • URL Building

  • Authentication with Sessions

  • Template & Template Inheritance

  • Error Handling

  • Integrating with Bootstrap

  • Interaction with Database (SQLite)

  • Invoking static resources

For more basic knowledge of Flask, you can refer to a tutorial on Tutorialspoint.

How to Run

  • Step 1: Make sure you have Python

  • Step 2: Install the requirements: pip install -r requirements.txt

  • Step 3: Go to this app's directory and run python app.py

Details about This Toy App

There are three tabs in this toy app

  • Public: this is a page which can be accessed by anyone, no matter if the user has logged in or not.

  • Private: Only logged-in user can access this page. Otherwise the user will get a 401 error page.

  • Admin Page: This part is only open to the user who logged in as "Admin". In this tab, the administrator can manage accounts (list, delete, or add).

A few accounts were set for testing, like admin (password: admin), test (password: 123456), etc. You can also delete or add accounts after you log in as admin.

References

Credict

Image private.jpg: https://commons.wikimedia.org/wiki/File:(315-365)_Locked_(6149414678).jpg

Image public.jpg: https://commons.wikimedia.org/wiki/File:Drown%3F!_(131380682).jpg

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.