app.config['UPLOAD_PATH'] = 'static\\upload\\'
@app.route("/account/my_exhibits", methods=["GET"])
@login_required
def show_exhibits():
db_sess = db_session.create_session()
my_exhibits = db_sess.query(Exhibit).filter(Exhibit.user == current_user).all()
return render_template("/admin/show_exhibits.html", title='Мои экспонаты',
exhibits=my_exhibits, path_to=app.config['UPLOAD_PATH'])
{% extends 'common/base.html' %}
{% block content %}
show_exhibits.html
{% include 'admin/admin_header.html' %}
<h4 class="uk-text-center">{{ title }}</h4>
<div class="uk-container uk-margin">
<a href="/account/create_exhibit" class="uk-button uk-button-default uk-align-center uk-width-1-5"
style="background-color: #ec621f">
Добавить новый
</a>
</div>
<div class="uk-container uk-margin">
{% for ex in exhibits %}
{% include 'common/exhibit.html' %}
{% endfor %}
</div>
{% endblock %}
<div>
<div class="uk-card uk-card-default uk-grid-collapse uk-child-width-1-2@s uk-margin" uk-grid>
<div class="uk-card-media-left uk-cover-container">
<img src="{{path_to+ex.photo }}" alt="" uk-cover>
<canvas width="600" height="400"></canvas>
</div>
<div>
<div class="uk-card-body">
<div class="uk-container uk-position-top-right uk-margin-small-right uk-margin-small-top">
<div class="uk-button-group">
<button class="uk-button uk-button-default" style="border:none">
<a href="/account/redact_exhibit/{{ex.id}}" uk-icon="icon: pencil"></a>
</button>
<button class="uk-button uk-button-default" type="button"
uk-toggle="target: #trash_dialog" uk-icon="icon: trash"
style="border:none">
</button>
</div>
</div>
<h3 class="uk-card-title">{{ ex.title }}</h3>
<p>{{ ex.content }}</p>
<div class="uk-margin uk-margin-right uk-position-bottom-right">
<p class="uk-text-right uk-text-meta">Добавлен {{ ex.created.strftime('%d-%m-%Y') }}</p>
</div>
</div>
</div>
</div>
</div>
127.0.0.1 - - [23/Jun/2023 15:54:14] "GET /account/static/upload/exhibits/13101423Jun2023.png HTTP/1.1" 404 -
127.0.0.1 - - [23/Jun/2023 15:54:14] "GET /account/static/upload/exhibits/13153223Jun2023.png HTTP/1.1" 404 -
Traceback (most recent call last):
File "C:/Users/user/Desktop/Пайтон/Beta test/p3.py", line 4, in <module>
soup = bs(requests.get('https://www.youtube.com/results?search_query=renegades+NIN9+remixMagic'), features='lxml')
File "C:\Users\user\AppData\Local\Programs\Python\Python38\lib\site-packages\bs4\__init__.py", line 307, in __init__
elif len(markup) <= 256 and (
TypeError: object of type 'Response' has no len()