text: # -*- coding: utf-8 -*-
  import os
  import logging
  
  from flask_appbuilder.security.manager import AUTH_DB
  from klinic.utils.logging_configurator import DefaultLoggingConfigurator
  
  
  logger = logging.getLogger(__name__)
  
  BASE_DIR = os.path.abspath(os.path.dirname(__file__))
  if 'KLINIC_HOME' in os.environ:
      DATA_DIR = os.environ['KLINIC_HOME']
  else:
      DATA_DIR = os.path.join(os.path.expanduser('~'), '.klinic')
  
  # Your App secret key
  SECRET_KEY = "deadbeefthisismyscretkeydeadbeef"
  
  # The SQLAlchemy connection string.
  # SQLALCHEMY_DATABASE_URI = "sqlite:///" + os.path.join(BASE_DIR, "app.db")
  # SQLALCHEMY_DATABASE_URI = 'mysql://myapp@localhost/myapp'
  SQLALCHEMY_DATABASE_URI = 'postgres://klinic:pas$w0rD@127.0.0.1/klinic'
  
  # Flask-WTF flag for CSRF
  CSRF_ENABLED = True
  
  # ------------------------------
  # GLOBALS FOR APP Builder
  # ------------------------------
  # Uncomment to setup Your App name
  APP_NAME = "超声绩效后台管理"
  
  # Uncomment to setup Setup an App icon
  APP_ICON = "http://113.31.147.198/20040.svg"
  
  # ----------------------------------------------------
  # AUTHENTICATION CONFIG
  # ----------------------------------------------------
  # The authentication type
  # AUTH_OID : Is for OpenID
  # AUTH_DB : Is for database (username/password()
  # AUTH_LDAP : Is for LDAP
  # AUTH_REMOTE_USER : Is for using REMOTE_USER from web server
  AUTH_TYPE = AUTH_DB
  
  # Uncomment to setup Full admin role name
  # AUTH_ROLE_ADMIN = 'Admin'
  
  # Uncomment to setup Public role name, no authentication needed
  # AUTH_ROLE_PUBLIC = 'Public'
  
  # Will allow user self registration
  # AUTH_USER_REGISTRATION = True
  
  # The default user self registration role
  # AUTH_USER_REGISTRATION_ROLE = "Public"
  
  # When using LDAP Auth, setup the ldap server
  # AUTH_LDAP_SERVER = "ldap://ldapserver.new"
  
  # Uncomment to setup OpenID providers example for OpenID authentication
  # OPENID_PROVIDERS = [
  #    { 'name': 'Yahoo', 'url': 'https://me.yahoo.com' },
  #    { 'name': 'AOL', 'url': 'http://openid.aol.com/<username>' },
  #    { 'name': 'Flickr', 'url': 'http://www.flickr.com/<username>' },
  #    { 'name': 'MyOpenID', 'url': 'https://www.myopenid.com' }]
  # ---------------------------------------------------
  # Babel config for translations
  # ---------------------------------------------------
  # Setup default language
  BABEL_DEFAULT_LOCALE = "zh"
  # Your application default translation path
  BABEL_DEFAULT_FOLDER = "translations"
  # The allowed translation for you app
  LANGUAGES = {
      # "en": {"flag": "gb", "name": "English"},
      "zh": {"flag": "cn", "name": "Chinese"},
  }
  # ---------------------------------------------------
  # Image and file configuration
  # ---------------------------------------------------
  # The file upload folder, when using models with files
  UPLOAD_FOLDER = BASE_DIR + "/app/static/uploads/"
  
  # The image upload folder, when using models with images
  IMG_UPLOAD_FOLDER = BASE_DIR + "/app/static/uploads/"
  
  # The image upload url, when using models with images
  IMG_UPLOAD_URL = "/static/uploads/"
  # Setup image size default is (300, 200, True)
  # IMG_SIZE = (300, 200, True)
  
  # Theme configuration
  # these are located on static/appbuilder/css/themes
  # you can create your own and easily use them placing them on the same dir
  # structure to override
  # APP_THEME = "bootstrap-theme.css"  # default bootstrap
  # APP_THEME = "cerulean.css"
  # APP_THEME = "amelia.css"
  # APP_THEME = "cosmo.css"
  # APP_THEME = "cyborg.css"
  # APP_THEME = "flatly.css"
  # APP_THEME = "journal.css"
  # APP_THEME = "readable.css"
  # APP_THEME = "simplex.css"
  # APP_THEME = "slate.css"
  # APP_THEME = "spacelab.css"
  # APP_THEME = "united.css"
  # APP_THEME = "yeti.css"
  
  # Default configurator will consume the LOG_* setting below.
  LOGGING_CONFIGURATOR = DefaultLoggingConfigurator()
  
  # Console Log Settings
  LOG_FORMAT = '%(asctime)s:%(levelname)s:%(name)s:%(message)s'
  LOG_LEVEL = 'DEBUG'
  
  # ---------------------------------------------------
  # Enable Time Rotate Log Handler
  # ---------------------------------------------------
  ENABLE_TIME_ROTATE = False
  TIME_ROTATE_LOG_LEVEL = 'DEBUG'
  FILENAME = os.path.join(DATA_DIR, 'klinic.log')
  ROLLOVER = 'midnight'
  INTERVAL = 1
  BACKUP_COUNT = 10
  
  # Whether to bump the logging level to ERROR on the flask_appbuilder package
  # Set to False if/when debugging FAB related issues like permission management.
  SILENCE_FAB = True
  
  # Whether or run the web server in debug mode or not.
  DEBUG = os.environ.get('FLASK_ENV') == 'development'
  