- templates(html):
from flask import Flask, render_template app = Flask(__name__) @app.route('/') def index(): return render_template('index.html') if __name__ == '__main__': app.run()
- static(css):直接寫在html檔案裡面
<!DOCTYPE html> <html> <head> <title>Page Title</title> <link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='style.css') }}"> </head> <body> <h1>This is a Heading</h1> <p>This is a paragraph.</p> </body> </html>
訂閱(Subscribe)
0 Comments