Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/xd-deng/flask-example
A minimal web app developed with Flask
https://github.com/xd-deng/flask-example
flask python
Last synced: 5 days ago
JSON representation
A minimal web app developed with Flask
- Host: GitHub
- URL: https://github.com/xd-deng/flask-example
- Owner: XD-DENG
- Created: 2017-07-01T10:38:56.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2024-03-05T23:10:43.000Z (8 months ago)
- Last Synced: 2024-10-17T06:55:18.456Z (20 days ago)
- Topics: flask, python
- Language: Python
- Size: 451 KB
- Stars: 107
- Watchers: 6
- Forks: 101
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# flask-example
A minimal web app developed with [Flask](http://flask.pocoo.org/) 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](https://www.tutorialspoint.com/flask/).
## 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
- http://flask.pocoo.org/
- https://www.tutorialspoint.com/flask/
## Credict
Image private.jpg: https://commons.wikimedia.org/wiki/File:(315-365)_Locked_(6149414678).jpgImage public.jpg: https://commons.wikimedia.org/wiki/File:Drown%3F!_(131380682).jpg