aboutsummaryrefslogtreecommitdiff
path: root/app/__init__.py
diff options
context:
space:
mode:
authorNavan Chauhan <navanchauhan@gmail.com>2020-09-08 20:03:41 +0530
committerNavan Chauhan <navanchauhan@gmail.com>2020-09-08 20:03:41 +0530
commit37076cab79175c0797ce781bb1cc4cd8e60187ce (patch)
tree0ea3f392124d108ca623cc93bf5f0ed41c4d8354 /app/__init__.py
parentb8ada840cfd5348d617ed3b1f35003ae622c9175 (diff)
added single config.ini to change variables
Diffstat (limited to 'app/__init__.py')
-rw-r--r--app/__init__.py24
1 files changed, 19 insertions, 5 deletions
diff --git a/app/__init__.py b/app/__init__.py
index b4b9ea8..66efb0f 100644
--- a/app/__init__.py
+++ b/app/__init__.py
@@ -1,9 +1,26 @@
from flask import Flask
-# Config Values
+import configparser
+config = configparser.ConfigParser()
+config.read('config.ini')
+
+DB_HOST = config['DATABASE']['HOST']
+DB_PORT = config['DATABASE']['PORT']
+DB_USER = config['DATABASE']['USER']
+DB_PASSWORD = config['DATABASE']['PASSWORD']
+DB_NAME = config['DATABASE']['NAME']
+UPLOAD_FOLDER = config['FILES']['UPLOAD_FOLDER']
+
+"""
+# Hardcoded Values
# location where file uploads will be stored
UPLOAD_FOLDER = './app/static/uploads'
DB_HOST = 'navanspi.duckdns.org' #'navanspi.duckdns.org'
+DB_PORT = 3306
+DB_USER = 'curieweb'
+DB_PASSWORD = 'curie-web-russian-54'
+DB_NAME = 'curie'
+"""
import subprocess
import hashlib
@@ -16,10 +33,7 @@ try:
except:
None
-DB_PORT = 3306
-DB_USER = 'curieweb'
-DB_PASSWORD = 'curie-web-russian-54'
-DB_NAME = 'curie'
+
# needed for session security, the flash() method in this case stores the message
# in a session
SECRET_KEY = 'Sup3r$3cretkey'