Skip to content

Commit

Permalink
Update Flask config (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
vishnuravi authored Nov 10, 2019
1 parent bfe3a63 commit d737050
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .flaskenv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
FLASK_APP = app.py
FLASK_ENV = development
6 changes: 3 additions & 3 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

app = Flask(__name__)

app.secret_key = '\xde\xb5W\xee{\x8b\xed\xb4\xf2\x91\xcdP\xdfM\xeb02\xd4\xc5\x90mh\xad*' #for dev only
app.config.from_object("config.DevelopmentConfig")

db = 'sensor.db'
db = app.config["DB_NAME"]

def create_connection(db):
con = None
Expand Down Expand Up @@ -95,4 +95,4 @@ def update_settings():


if __name__ == '__main__':
app.run(debug=True, host='0.0.0.0')
app.run(host='0.0.0.0')
9 changes: 9 additions & 0 deletions config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
class Config(object):
DEBUG = False
TESTING = False

class DevelopmentConfig(Config):
DEBUG = True
DB_NAME = 'sensor.db'
SECRET_KEY = '\xde\xb5W\xee{\x8b\xed\xb4\xf2\x91\xcdP\xdfM\xeb02\xd4\xc5\x90mh\xad*'
API_URL = ''

0 comments on commit d737050

Please sign in to comment.