My current project looks like this:
├── __init__.py
├── pages
├── settings.py
├── static
├── templates
│ ├── article.html
│ ├── base.html
│ ├── index.html
│ └── posts.html
├── view
│ ├── article.py
│ ├── home.py
│ ├── index.py
│ └── postwall.py
I breaked views.py(no longer in the project) into files and those files cannot generate url dynamically anymore. What i had in article.py is:
from flask import Blueprint, render_template
from app import articles
article = Blueprint('article',__name__)
@article.route('/article/<path:path>/')
def page(path):
article = articles.get_or_404(path)
return render_template('article.html',page=article)
Meanwhile, posts.html which offers the link button to articles doesn't work anymore:
<a href="{{ url_for('page', path=page.path) }}">More -></a>
What is the problem?Did I miss something in the blueprint file?