Should the templates be in the templates folder of the templates or the global template folder?

I see that there are two ways to structure patterns in a project. Templates can be saved in a folder templates/in the drawing, or each drawing has a folder inside the global templates folder. What is the difference between the two? Why should I use one over the other?

app/
    blueprint1/
        __init__.py
        views.py
        templates/
    blueprint2/
        __init__.py
        views.py
        templates/
    templates/  # Global templates folder
app/
    blueprint1/
        __init__.py
        views.py
    blueprint2/
        __init__.py
        views.py
    templates/  # Global templates folder
        blueprint1/
        blueprint2/
+4
source share
1 answer

, Flask, Jinja . , . , , , , , . , , , , .

project/
    package/
        __init__.py
        blueprint1/
            __init__.py
            templates/
                blueprint1/
                    page.html  # default
        templates/
            blueprint1/
                page.html  # overrides blueprint
+4

Source: https://habr.com/ru/post/1611454/


All Articles