Skip to content

Commit b7dfb93

Browse files
author
App Generator
committed
Phase 3 - Use the new Config file
- Variables are moved to the new file
1 parent f219c90 commit b7dfb93

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

app/__init__.py

+2-12
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,11 @@
1010
from flask import Flask
1111
from flask_sqlalchemy import SQLAlchemy
1212

13-
# Grabs the folder where the script runs.
14-
basedir = os.path.abspath(os.path.dirname(__file__))
15-
1613
# Inject Flask magic
1714
app = Flask(__name__)
1815

19-
# App Config - the minimal footprint
20-
app.config['TESTING'] = True
21-
22-
# Set up the App SECRET_KEY
23-
SECRET_KEY = 'S_U_perS3crEt_KEY#9999'
24-
25-
# SQLAlchemy Settings
26-
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///' + os.path.join(basedir, 'db.sqlite3')
27-
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
16+
# Load configuration
17+
app.config.from_object('app.config.Config')
2818

2919
# Construct the DB Object (SQLAlchemy interface)
3020
db = SQLAlchemy (app)

0 commit comments

Comments
 (0)