r/flask

▲ 5 r/flask

What's the difference between bcrypt and flask-bcrypt?

I am also asking about other flask-* libraries compared to standard versions. I know there are some that benefit from integration e.g. managing database connections but the ones like flask-bcrypt make me confused.

reddit.com
u/Neoneq_ — 5 days ago
▲ 19 r/flask

Reusable Flask starter app with auth, audit, admin, and plugin support

My original intention was to recreate a basic auth system like one I built in PHP years ago. It kinda expanded a bit, so now I've got a plugin system that I can write interchangeable plugins for.

It currently includes authentication, Argon2id password hashing, MFA, session management, password and email lifecycle, roles/admin controls, auditing, rate limiting, SQLite/PostgreSQL support, migrations, and Docker/Compose deployment support. It isn't fully batteries included, so some downstream work is still required depending on the application. I built it in a way that maintains its flexibility while handling the most common things I think are needed across the board for my projects.

I recently finished another security and deployment pass, added better bootstrap behavior, and added additional regression tests.

The project is open source. Technical feedback is welcome.

GitHub: https://github.com/alias454/Flask-AAS

u/alias454 — 4 days ago
▲ 0 r/flask+1 crossposts

Build API in one line code with FlashAPI

What if creating a REST API in Python no longer required writing the same boilerplate over and over again?

I created FlashAPI to answer a very simple problem:

When we develop an application, we often spend time rewriting the same things:

→ RAW

→ pagination

→ search and filters

→ sort

→ permissions

→ exports

→ soft delete

→ audit

→ repetitive endpoints...

The problem is not to know how to develop them.

The problem is having to redevelop them with each project.

With FlashAPI, you define your Python models and you automatically get a complete REST API around them.

⚡ Compatible with FastAPI, Flask and Django

🐍 Pydantic, SQLAlchemy, dataclasses

🔓 Open source under Apache 2.0

🚫 No proprietary runtime, no vendor lock-in

And above all, FlashAPI does not seek to replace your code.

You keep your business logic, your personalized routes and the ability to disable or customize what you don't need.

The objective is simple:

Less boilerplate → more time to build what makes your application unique.

👉 GitHub: https://github.com/HackermanMe/flashapi

I am now looking for Python developers to test and contribute.

#Python #FastAPI #Django #Flask #OpenSource #Backend #RESTAPI #SoftwareEngineering

u/rakakayiouu — 8 days ago
▲ 2 r/flask

How do I downgrade with flask migrate?

Situation 1

If I go

flask db migrate -m "my changes"

but have not run flask db upgrade and I want to downgrade flask migrate just delete the migration file

For example

Here is an example where the file is located.

migrations/

└── versions/

└── a1b2c3d4_my_changes.py

rm migrations/versions/a1b2c3d4_my_changes.py or delete the file manually

Situation 2

Also note

do not delete the migration file before running flask db downgrade if that migration has already been applied with flask db upgrade.

If you already ran flask db upgrade you go

flask db downgrade

This will make migrate downgrade.

The previous command is = to flask db downgrade -1.

if I want to further downgrade I go

flask db downgrade a1b2c3d4

Here is an example where the file is located.

migrations/

└── versions/

└── rgegrgrg_original_migration.py

└── a1b2c3d4_my_changes.py

Or I could go

flask db downgrade -2

to downgrade 2 times.

Also to find the correct migration I should go

flask db history

When I try situation 1 then situation 2 I get the error

INFO [alembic.runtime.migration] Context impl SQLiteImpl.

INFO [alembic.runtime.migration] Will assume non-transactional DDL.

ERROR [flask_migrate] Error: Target database is not up to date.

How do I fix this?

Also if I made any mistakes in the processes above can someone help? I typed how to do this into ai because I could not find any resources by googling that are recent so I assume the ai made a mistake.

reddit.com
u/0_emordnilap_a_ton — 11 days ago