-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.py
42 lines (30 loc) · 1.08 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
from flask import Flask
from routes.index import indexB
from models.models import db
from routes.account import accounts
from routes.benefit import benefits
from flask_moment import Moment
from routes.admin import admin
# Registering Package Instance
app = Flask(__name__)
moment = Moment(app)
moment.init_app(app)
# @app.template_filter('humanize')
# def humanize(value):
# return datetime.strftime(date(int(value)))
# Blueprint registering
app.register_blueprint(indexB)
app.register_blueprint(accounts, url_prefix='/user')
app.register_blueprint(benefits,url_prefix='/item')
app.register_blueprint(admin, url_prefix='/admin')
# Database Connection & Session
# app.config['SQLALCHEMY_DATABASE_URI'] = "mysql://root@localhost/flasky"
app.config['SQLALCHEMY_DATABASE_URI'] = "mysql://b363042b9833fd:[email protected]/heroku_9da55108e046c0b"
app.config['SECRET_KEY'] = 'pbkdf2:sha256:150000$Ciwc'
# Connecting DB Model to app.py
db.init_app(app)
# with app.app_context():
# db.drop_all()
# db.create_all(app=app)
if __name__ == "__main__":
app.run(threaded=True)