Skip to content
Snippets Groups Projects
Commit e3c07bff authored by Yinglong Fang's avatar Yinglong Fang
Browse files

Upload New File

parent 81844b8b
No related branches found
No related tags found
No related merge requests found
app.py 0 → 100644
from flask import Flask, render_template, Blueprint, redirect, url_for, request
import sqlite3
app = Flask(__name__, template_folder='templates')
@app.route("/")
@app.route("/home")
def home():
return render_template('index.html')
def get_db_connection():
conn = sqlite3.connect('database.db')
conn.row_factory = sqlite3.Row
return conn
@app.route("/skill")
def skill():
conn = get_db_connection()
cur = conn.cursor()
cur.execute('SELECT * FROM skill')
skills = cur.fetchall()
return render_template('skill.html', skills=skills)
@app.route("/project")
def project():
return render_template('project.html')
@app.route("/education")
def education():
conn = get_db_connection()
cur = conn.cursor()
cur.execute('SELECT * FROM education')
educations = cur.fetchall()
return render_template('education.html', educations=educations)
@app.route("/contact")
def contact():
return render_template('contact.html')
if __name__ == '__main__':
app.run(debug=False)
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment