-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.py
56 lines (38 loc) · 1.3 KB
/
app.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
from flask import Flask, render_template, request, redirect, session, jsonify
from flask_session import Session
from werkzeug.security import check_password_hash, generate_password_hash
import sqlite3 as sql
import os
from flask_cors import CORS
app = Flask(__name__, static_folder='static')
# Ensure templates are auto-reloaded
app.config['TEMPLATES_AUTO_RELOAD'] = True
# Configure session to use filesystem (instead of signed cookies)
app.config['SESSION_PERMANENT'] = False
app.config['SESSION_TYPE'] = 'filesystem'
Session(app)
# Protect Security
CORS(app)
@app.route('/', methods=['GET'])
def index():
'''Displays Homepage and create posts'''
return render_template('index.html')
@app.route('/education', methods=['GET'])
def education():
'''Display education page'''
return render_template('education.html')
@app.route('/hobbies', methods=['GET'])
def hobbies():
'''Display hobbies page'''
return render_template('hobbies.html')
@app.route('/contact', methods=['GET'])
def contact():
'''Display contact info page'''
return render_template('contact.html')
@app.route('/open-source', methods=['GET'])
def open_source():
'''Display open-source page'''
return render_template('open-source.html')
# Scroll down to projects
if __name__ == '__main__':
app.run(debug=True)