This commit is contained in:
17
app.py
17
app.py
@@ -66,9 +66,20 @@ def page_posts_from_db():
|
||||
return render_template("interactive-posts.html", postos=postos)
|
||||
|
||||
|
||||
# @app.route('/post_my_post', method=['POST'])
|
||||
# def post_a_post():
|
||||
# pass
|
||||
@app.route('/post_my_post', method=['POST'])
|
||||
def post_a_post():
|
||||
|
||||
|
||||
postos = db.collection('posts')
|
||||
novenkiy = {
|
||||
'texto': 'next post is this',
|
||||
}
|
||||
|
||||
#### TODO проверить как-то по-умному что мы таки его добавили
|
||||
metadata = postos.insert(novenkiy, overwrite_mode='update')
|
||||
|
||||
return render_template("i-posts.html", postos=[novenkiy])
|
||||
|
||||
|
||||
# @app.route('/post_my_file', method=['POST'])
|
||||
# def post_a_file():
|
||||
|
||||
Reference in New Issue
Block a user