I am using Flask blueprints.
My web app Attendance Manager has three types of users, admin, teacher and student.
Here is how a part of the file structure looks:
+---app.py
|
|
+---student
| | student.py
| | __init__.py
| |
| +---static
| | +---css
| | | login-page.css
| | | signup-page.css
| | |
| | \---js
| | firebaseConfig.js
| |
| +---templates
| | base.html
| | student-login-page.html
| | student-signup-page.html
app.py:
app.register_blueprint(student, url_prefix='/student')
student.py:
student = Blueprint('student', __name__, static_folder='static', template_folder='templates')
student-login-page.html:
<link rel="stylesheet" type="text/css" href="{{ url_for('student.static', filename='css/login-page.css') }}">
Adding 'the_name_of_the_blueprint.static' to the first parameter of url_for() in the student-login-page.html (or wherever you are linking your css) helped me resolve the problem.
Found the solution here, in the official docs.
This GitHub issue or this Reddit post might help you if this did not resolve your problem.
All the best!