From f59b3ba871f1086beb147c2de46f0cd60ce070c2 Mon Sep 17 00:00:00 2001 From: Mitsuo Tokumori Date: Fri, 27 Oct 2023 19:56:12 -0500 Subject: Add auth view and static files --- README.md | 33 ++++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index 6433ba2..77aa31e 100644 --- a/README.md +++ b/README.md @@ -14,8 +14,9 @@ flask --app flaskr run --debug ## Learning resources -* https://flask.palletsprojects.com/en/3.0.x/#user-s-guide -* https://sqlite.org/lang.html +* Flask: https://flask.palletsprojects.com/en/3.0.x/#user-s-guide +* DB: https://sqlite.org/lang.html +* Template: https://jinja.palletsprojects.com/templates/ Concepts: @@ -29,7 +30,33 @@ Concepts: * flask.session: dict that stores data across requests (cookies) (securely signed with SECRET_KEY) * *endpoint*: name associated with a view, `.` +* Templates: Used to render HTML. Uses Jinja template library. Autoscapes any + data that is rendered in HTML templates, so it's safe to render user input. + * `{{ }}` denotes expressions (output) (similar to python) + * `{% %}` denotes control flow statements (similar to pseudo-code) + * Automatically available: `g`, `url_for`, and more + * In base.html you define "blocks" placeholder which are later defined in + other templates that extend base.html Gotchas: -* Remember to call db.commit() after modifying DB (DML). \ No newline at end of file +* Remember to call db.commit() after modifying DB (DML). + +Browser warnings and errors: + +* https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie#samesitesamesite-value + +## Discussion + +Pros: + +* Flask is AWESOME, it's simple, it's elegant, it's enjoyable to code with. + Following the tutorial provides you all the basic tools to begin creating + projects with flask. +* It's secure, provides you with cryptographic signature for cookies and escapes + HTML transparently to the developer. + +Cons: + +* Maybe scalability and performance is lower compared to PHP or Javascript + web applications. \ No newline at end of file -- cgit v1.2.3