Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] use Flask 3.0.0 . deprecate using flask-validator #64

Draft
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

danhimalplanet
Copy link

  • update Docker file to use Python 3.11 , since the plan is to use this in a Debian bookworm. But since the plan is to use a Docker instance, maybe the Debian bookworm doesn't matter. Anyway it's a good thing to start using Python 3.11
  • added a docker-compose.yaml I use for local development
  • 'from flask import Markup' fails. now importing Markup with 'from markupsafe import Markup'. Not sure if that's the right solution
  • commented out "load_dotenv(os.environ['DONATE_DOTENV'])" in autoapp.py . Flask appears to load up the .env file without it
  • 'from donate.database import db' doesn't work at all. I don't see a db module to import in donate.database. 'from donate.extensions import db' does work. Hope that's ok!
  • pypi module flask-validator hasn't been touched in 3 years. flask-validator uses an older version of flask-sqlalchemy. Recent changes to Flask and Werkzeug don't work with the older version of flask-sqlalchemy. I replaced use of flask-validator with sqlalchemy.orm and a more current version of flask_sqlalchemy. Hope it works!
  • updated requirements.txt with what I am using with Python 3.11 and Flask 3.0.0.

I did flask db init

(venv) ➜  python-nb-donate git:(danh_fixes) flask db init
[2023-12-01 13:38:55,140] INFO in autoapp: App initialized
Error: Directory migrations already exists and is not empty

After starting Flask, I get the response:

OperationalError
sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) no such table: project
[SQL: SELECT project.id AS project_id, project.name AS project_name, project."desc" AS project_desc, project.goal AS project_goal, project.created_at AS project_created_at, project.updated_at AS project_updated_at 
FROM project 
WHERE project.name != ?]
[parameters: ('General Fund',)]
(Background on this error at: https://sqlalche.me/e/20/e3q8)

So either the code changes I tried are bad, or I don't know how to init the db for development

@danhimalplanet danhimalplanet added enhancement New feature or request help wanted Extra attention is needed invalid This doesn't seem right question Further information is requested labels Dec 1, 2023
@danhimalplanet danhimalplanet requested review from jof and SuperQ December 1, 2023 21:43
@danhimalplanet danhimalplanet self-assigned this Dec 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed invalid This doesn't seem right question Further information is requested
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant