From becc2342638e09e7187a7ad4288a6f6bca9ce064 Mon Sep 17 00:00:00 2001 From: finn Date: Wed, 31 Jul 2024 23:56:27 -0700 Subject: [PATCH] begin mg tut framework in be --- .gitignore | 3 ++- backend/.flaskenv | 2 ++ backend/README.md | 4 ++++ backend/app/__init__.py | 6 ++++++ backend/app/routes.py | 7 +++++++ backend/microblog.py | 2 ++ backend/{app.py => oldapp.py} | 0 backend/requirements.txt | 8 ++++++-- backend/requirements.txt.orig | 2 -- backend/templates/about.html | 11 +++++++++++ backend/templates/basictemp.html | 9 +++++++++ backend/templates/home.html | 11 +++++++++++ 12 files changed, 60 insertions(+), 5 deletions(-) create mode 100644 backend/.flaskenv create mode 100644 backend/README.md create mode 100644 backend/app/__init__.py create mode 100644 backend/app/routes.py create mode 100644 backend/microblog.py rename backend/{app.py => oldapp.py} (100%) mode change 100755 => 100644 backend/requirements.txt delete mode 100755 backend/requirements.txt.orig create mode 100644 backend/templates/about.html create mode 100644 backend/templates/basictemp.html create mode 100644 backend/templates/home.html diff --git a/.gitignore b/.gitignore index b331f09..bd1860d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ gitea/ .env pmb-pf/ -backend/giapp.py +venv + diff --git a/backend/.flaskenv b/backend/.flaskenv new file mode 100644 index 0000000..046b50c --- /dev/null +++ b/backend/.flaskenv @@ -0,0 +1,2 @@ +FLASK_APP=microblog.py + diff --git a/backend/README.md b/backend/README.md new file mode 100644 index 0000000..c3fdd6b --- /dev/null +++ b/backend/README.md @@ -0,0 +1,4 @@ + +pip: +pip install flask +pip install python-dotenv diff --git a/backend/app/__init__.py b/backend/app/__init__.py new file mode 100644 index 0000000..5bdbcd0 --- /dev/null +++ b/backend/app/__init__.py @@ -0,0 +1,6 @@ +from flask import Flask + +app = Flask(__name__) + +from app import routes + diff --git a/backend/app/routes.py b/backend/app/routes.py new file mode 100644 index 0000000..05a0bd4 --- /dev/null +++ b/backend/app/routes.py @@ -0,0 +1,7 @@ +from app import app + +@app.route('/') +@app.route('/index') +def index(): + return "Hello, World!" + diff --git a/backend/microblog.py b/backend/microblog.py new file mode 100644 index 0000000..f099917 --- /dev/null +++ b/backend/microblog.py @@ -0,0 +1,2 @@ +from app import app + diff --git a/backend/app.py b/backend/oldapp.py similarity index 100% rename from backend/app.py rename to backend/oldapp.py diff --git a/backend/requirements.txt b/backend/requirements.txt old mode 100755 new mode 100644 index c189106..c1e99d5 --- a/backend/requirements.txt +++ b/backend/requirements.txt @@ -1,4 +1,8 @@ +blinker==1.8.2 +click==8.1.7 Flask==3.0.3 +itsdangerous==2.2.0 +Jinja2==3.1.4 +MarkupSafe==2.1.5 +python-dotenv==1.0.1 Werkzeug==3.0.3 -mysql-connector-python -pyuwsgi diff --git a/backend/requirements.txt.orig b/backend/requirements.txt.orig deleted file mode 100755 index 924a5fd..0000000 --- a/backend/requirements.txt.orig +++ /dev/null @@ -1,2 +0,0 @@ -Flask==2.0.1 -mysql-connector==2.2.9 diff --git a/backend/templates/about.html b/backend/templates/about.html new file mode 100644 index 0000000..7318c07 --- /dev/null +++ b/backend/templates/about.html @@ -0,0 +1,11 @@ + + + + + + + +

About

+ + + diff --git a/backend/templates/basictemp.html b/backend/templates/basictemp.html new file mode 100644 index 0000000..cbbcf44 --- /dev/null +++ b/backend/templates/basictemp.html @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/backend/templates/home.html b/backend/templates/home.html new file mode 100644 index 0000000..fa70d65 --- /dev/null +++ b/backend/templates/home.html @@ -0,0 +1,11 @@ + + + + + + + +

Home

+ + +