Hi,
I'm trying to build one flask-based application using the pythonanywhere.com website but when I try to apply external CSS it's not working at all and always showing me the response in pink background-color which I haven't applied in my code. I tried to figure it out the reason behind it but unable to understand.
This is my code snippet please guide me where I am doing wrong!
My CSS CODE: /home/rajnishjha/mysite/static/mystyle.css
/home/rajnishjha/mysite/static/mystyle.css
body
{
background-color: orange;
}
My HTML CODE: /home/rajnishjha/mysite/templates/home.html
<html>
<head>
<!--This is a way to link or apply css file to my HTML code-->
<link rel="stylesheet" href="../static/mystyle.css">
</head>
<body bgcolor="yellow">
<h1>Hello Rajnish!!</h1>
</body>
</html>
MY Backend code: /home/rajnishjha/mysite/flask_app.py
from flask import Flask
from flask import render_template
app = Flask(name)
@app.route('/')
def hello_world():
return render_template('home.html')
#return 'Hello from flask!'
@app.route('/name')
def demo():
return 'Rajnish'
@app.route('/city')
def demo2():
return 'Bangalore'