-
Notifications
You must be signed in to change notification settings - Fork 3
/
__init__.py
47 lines (36 loc) · 1.07 KB
/
__init__.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
from flask import Flask, render_template, request, redirect, url_for, flash
import os
def create_app():
# Create a Flask Instance
app = Flask(__name__, instance_relative_config=True)
# Config secret key
app.config.from_mapping(
SECRET_KEY='IamConqKiller',
DATABASE = os.path.join(app.instance_path, 'taskflowr.sqlite')
)
try:
os.makedirs(app.instance_path)
except OSError:
pass
# Create a route decorator
@app.route('/')
def home():
# Render layout.html from templates folder
return render_template('tasks.html')
# now render feature.html
@app.route('/features')
def features():
return render_template('features.html')
@app.route('/faqs')
def faqs():
return render_template('faqs.html')
@app.route('/about')
def about():
return render_template('about.html')
from . import datab
datab.init_app(app)
from . import auth
app.register_blueprint(auth.bp)
return app
if __name__ == '__main__':
create_app().run(debug=True)