zkt21/z2/web/config.py

29 lines
712 B
Python
Raw Permalink Normal View History

2021-04-18 11:21:46 +00:00
# config.py
import os
class BaseConfig(object):
SECRET_KEY = os.environ['SECRET_KEY']
DEBUG = os.environ['DEBUG']
DB_NAME = os.environ['DB_NAME']
DB_USER = os.environ['DB_USER']
DB_PASS = os.environ['DB_PASS']
DB_SERVICE = os.environ['DB_SERVICE']
DB_PORT = os.environ['DB_PORT']
SQLALCHEMY_DATABASE_URI = 'postgresql://{0}:{1}@{2}:{3}/{4}'.format(
DB_USER, DB_PASS, DB_SERVICE, DB_PORT, DB_NAME
)
# class BaseConfig(object):
# SECRET_KEY = 'hi'
# DEBUG = True
# DB_NAME = 'postgres'
# DB_SERVICE = 'localhost'
# DB_PORT = 5432
# SQLALCHEMY_DATABASE_URI = 'postgresql://{0}:{1}/{2}'.format(
# DB_SERVICE, DB_PORT, DB_NAME
# )