Skip to content
Snippets Groups Projects
Commit 9160aa6b authored by Ossi Laine's avatar Ossi Laine
Browse files

Decoupled config

parent 3962ca68
No related branches found
No related tags found
No related merge requests found
......@@ -13,4 +13,5 @@ config.py
*.db
/embody
/app/static/lib
.env
import os
basedir = os.path.abspath(os.path.dirname(__file__))
from decouple import config
class Config(object):
#seret key is set in __ini__.py
......@@ -19,10 +21,10 @@ class Config(object):
#MariaDB mysql database settings
MYSQL_USER = 'rating'
MYSQL_PASSWORD = 'rating_passwd'
MYSQL_SERVER = 'localhost'
MYSQL_DB = 'rating_db'
MYSQL_USER = config('MYSQL_USER')
MYSQL_PASSWORD = config('MYSQL_PASSWORD')
MYSQL_SERVER = config('MYSQL_SERVER')
MYSQL_DB = config('MYSQL_DB')
SQLALCHEMY_DATABASE_URI = 'mysql+pymysql://'+MYSQL_USER+':'+MYSQL_PASSWORD+'@'+MYSQL_SERVER+'/'+MYSQL_DB+'?charset=utf8mb4'
......
......@@ -54,3 +54,4 @@ visitor==0.1.3
Werkzeug==0.14.1
WTForms==2.2.1
WTForms-SQLAlchemy==0.1
python-decouple
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment