I have problem with rendering html / css.
main:
from quart import Quart, render_template, redirect, url_for
app = Quart(__name__)
@app.route("/")
async def index():
return await render_template("index.html")
app.run(debug=True)
index.html:
<!doctype html>
<html lang="en">
<head>
<link rel="stylesheet" href="index/style.css">
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Some title</title>
</head>
<body>
<div class="container">
<img src="index/some_image.png" alt="something" style="width:50%;">
<a href="/login">
<button class="button button_Login">Login</button>
</a>
</div>
</body>
</html>
style.css:
.container {
position: relative;
text-align: center;
}
.container .button_Login {
position: absolute;
bottom: 1%;
left: 50%;
transform: translate(-50%, -50%);
background-color: black;
border: 3px solid #eeccff;
color: white;
padding: 15px 32px;
text-align: center;
border-radius: 4px;
font-size: 20px;
transition-duration: 0.4s
}
.container .button_Login:hover {
color: black;
background-color: #eeccff;
}
.button_Login:active {
position: relative;
top: 2px;
}
body {
background: black;
}
file structure:
app
templates
index
some_image.png
style.css
index.html
main.py
When I look on preview in PyCharm, everything works just fine; but when I try to run the code, website shows css and png files exist; but there is nothing inside of them.
Chrome was showing me three errors:
Failed to load resource: the server responded with a status of 404 () style.css:1
Failed to load resource: the server responded with a status of 404 () Amethyst.png:1
Failed to load resource: the server responded with a status of 404 () style.css:1