Flask не видит css
/Project
- app.py
/main
/templates
-index.html
/static
-style.css
-main.py
Структура проекта такая.
# main.py
from flask import Blueprint, render_template
new = Blueprint('new', __name__, template_folder='templates', static_folder='static')
@new.route('/')
def main_page():
return render_template('index.html')
# app.py
from flask import Flask, render_template
from main.main import new
app = Flask(__name__, template_folder='templates', static_folder='main/static')
app.register_blueprint(new)
if __name__ == '__main__':
app.run()
Так подключаю css.
<link rel= "stylesheet" type= "text/css" href= "../static/style.css">
Проблема заключается в том что если из файла app.py убрать пути к папкам templates и static то он отказывается воспринимать css, а я хочу сделать еще несколько директорий как main, где будут такие же static и templates. Сам шаблон он видит, потому что через настройки самого Pycharm назначил папку для templates.
Еще не очень понимаю почему я вообще должен указывать полный путь к файлу css, если я уже указал ему на папку static.