[1] Refine README; [2] Use default setting when run the app
This commit is contained in:
11
README.md
11
README.md
@@ -19,7 +19,15 @@ The main purpose is to introduce how to implement the essential elements in web
|
|||||||
For more basic knowledge of Flask, you can refer to [a tutorial on Tutorialspoint](https://www.tutorialspoint.com/flask/).
|
For more basic knowledge of Flask, you can refer to [a tutorial on Tutorialspoint](https://www.tutorialspoint.com/flask/).
|
||||||
|
|
||||||
|
|
||||||
## Details
|
## 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
|
There are three tabs in this toy app
|
||||||
|
|
||||||
@@ -33,6 +41,7 @@ There are three tabs in this toy app
|
|||||||
A few accounts were set for testing, like ***admin*** (password: admin), ***test_1*** (password: 123456), etc. You can also delete or add accounts after you log in as ***admin***.
|
A few accounts were set for testing, like ***admin*** (password: admin), ***test_1*** (password: 123456), etc. You can also delete or add accounts after you log in as ***admin***.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## References
|
## References
|
||||||
|
|
||||||
- http://flask.pocoo.org/
|
- http://flask.pocoo.org/
|
||||||
|
|||||||
7
app.py
7
app.py
@@ -37,10 +37,6 @@ def FUN_private():
|
|||||||
else:
|
else:
|
||||||
return abort(401)
|
return abort(401)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@app.route("/admin/")
|
@app.route("/admin/")
|
||||||
def FUN_admin():
|
def FUN_admin():
|
||||||
if session.get("current_user", None) == "ADMIN":
|
if session.get("current_user", None) == "ADMIN":
|
||||||
@@ -101,6 +97,5 @@ def FUN_add_user():
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
app.run(debug=True, port = 9000, host="0.0.0.0")
|
app.run(debug=True)
|
||||||
|
|||||||
Reference in New Issue
Block a user