Added configuration file support.
This commit is contained in:
parent
1f9e9ee650
commit
39db433854
2
src/.gitignore
vendored
2
src/.gitignore
vendored
@ -1,2 +1,4 @@
|
||||
*.pyc
|
||||
__pycache__
|
||||
config.py
|
||||
|
||||
|
@ -18,12 +18,13 @@
|
||||
from flask import Flask
|
||||
from flask.ext.sqlalchemy import SQLAlchemy
|
||||
from sqlalchemy.orm import sessionmaker
|
||||
import config
|
||||
|
||||
# The app
|
||||
app = Flask(__name__)
|
||||
|
||||
app.config['SQLALCHEMY_DATABASE_URI'] = 'postgresql://accountant:accountant@localhost/accountant'
|
||||
app.config['SQLALCHEMY_RECORD_QUERIES'] = True
|
||||
app.config['SQLALCHEMY_DATABASE_URI'] = config.db_uri
|
||||
app.config['SQLALCHEMY_RECORD_QUERIES'] = config.debug
|
||||
|
||||
db = SQLAlchemy(app)
|
||||
|
||||
|
3
src/config.py.dist
Normal file
3
src/config.py.dist
Normal file
@ -0,0 +1,3 @@
|
||||
|
||||
db_uri='postgresql://accountant:accountant@localhost/accountant'
|
||||
debug=True
|
Loading…
Reference in New Issue
Block a user