12345678910111213141516171819202122 |
- #!/usr/bin/env python
- # -*- encoding: utf-8 -*-
- '''
- @Contact : liuyuqi.gov@msn.cn
- @Time : 2024/07/29 13:48:28
- @License : Copyright © 2017-2022 liuyuqi. All Rights Reserved.
- @Desc : config
- '''
- import os
- class Settings(object):
- """ settings for app """
- # read config from .env
- if not os.path.exists('.env'):
- raise Exception('please create.env file')
- with open('.env') as f:
- for line in f:
- if line.startswith('FLY_'):
- k, v = line.strip().split('=')
- os.environ[k] = v
- settings = Settings()
|