XD-DENG c072aa771d For Private page, add feature 'take note'
This makes this app much more meaningful. For this feature, a new database table is added. More complicated logics are also needed, for example, we use hash(user ID + timestamp + note contant) as the unique id of each note (it's necessary when we try to delete a note)
2017-07-03 22:34:58 +08:00
2017-07-01 18:37:53 +08:00
2017-07-01 18:37:53 +08:00
2017-07-01 22:18:33 +08:00

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 packages flask, hashlib, and sqlite3 installed.

  • Step 2: 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

Description
No description provided
Readme 523 KiB
Languages
Python 64.7%
HTML 34.6%
Dockerfile 0.7%