весь проект тут https://github.com/spermspace/flaskBlog/

вопрос по flask🔞🔞

есть ссылка в index.html

<a href="{{ url_for('posts.post_detail', slug=post.slug) }}">{{ post.title }}</a>



есть blueprint который генрит её

@posts.route('/<slug>')

def post_detail(slug):

post = Post.query.filter(Post.slug==slug).first()

tags = post.tags

return render_template('posts/post_detail.html', post=post, tags=tags)



но веркцойг пишет следующее

File "/home/kiril/desktop/flask/app/posts/templates/posts/index.html", line 1, in top-level template code

{% extends 'base.html' %}

File "/home/kiril/desktop/flask/app/templates/base.html", line 54, in top-level template code

{% block content %}

File "/home/kiril/desktop/flask/app/posts/templates/posts/index.html", line 15, in block "content"

<a href="{{ url_for('posts.post_detail', slug=post.slug) }}">{{ post.title }}</a>

File "/usr/local/lib/python3.5/dist-packages/flask/helpers.py", line 333, in url_for

return appctx.app.handle_url_build_error(error, endpoint, values)

File "/usr/local/lib/python3.5/dist-packages/flask/app.py", line 1805, in handle_url_build_error

reraise(exc_type, exc_value, tb)

File "/usr/local/lib/python3.5/dist-packages/flask/_compat.py", line 33, in reraise

raise value

File "/usr/local/lib/python3.5/dist-packages/flask/helpers.py", line 323, in url_for

force_external=external)

File "/usr/local/lib/python3.5/dist-packages/werkzeug/routing.py", line 1768, in build

raise BuildError(endpoint, values, method, self)

werkzeug.routing.BuildError: Could not build url for endpoint 'posts.post_detail'. Did you forget to specify values ['slug']?



кому бить лицо?)



#python #код #django #питон #джанго #программирование #cod #coding #ML #DataMining #deeplearning #neuralnets #neuralnetworks #neuralnetworks #ArtificialIntelligence #MachineLearning #DigitalTransformation #tech #ML #python