플라스크

3444 단어
from flask import Flask 

app = Flask(__name__)

@app.route('/')
@app.route('/index')
@app.route('/home')
def index():
    return "<h1>Hello from Flask!</h1>"


템플릿/포함/footer.html

<div class="container-fluid text-center bottom-container">
    <footer>
        <p>Copyright &copy;2019-2020. Universal Tech Academy. All rights reserved.</p>
    </footer>
</div>


템플릿/index.html

{% include "includes/footer.html" %}



href="{{ url_for('index') }}"


색인은 route.py의 함수 이름입니다.

@app.route('/')
@app.route('/index')
@app.route('/home')
def index():
    return render_template('index.html', login=False)




GET method

좋은 웹페이지 즐겨찾기