X
X
xxxfdd2020-04-26 18:32:16
Flask
xxxfdd, 2020-04-26 18:32:16

Why is the image not showing up on the site?

5ea5a95e9cff5484788092.png
The code:

@app.route('/image_sample')
def image():
    return '''<img src="{}" alt="здесь должна была быть картинка, 
    но не нашлась">'''.format(url_for('static', filename='img/gg.jpg'))

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dev12345, 2020-04-26
@Dev12345

do it via HTML code:

<html>
    <head>
        <title>None</title>
    </head>
    <body>
        <img src="static/gg.jpg">
    </body>
</html>

D
Dimonchik, 2020-04-26
@dimonchik2013

logs
and
collectstatic

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question