forked from ZaPF/anmeldesystem
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.py
53 lines (43 loc) · 1.48 KB
/
config.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import os
basedir = os.path.abspath(os.path.dirname(__file__))
class Config:
FLASK_COVERAGE = 0
PREFERRED_URL_SCHEME = 'https'
ZAPFAUTH_BASE_URL = 'https://auth.zapf.in/api/'
ZAPFAUTH_AUTHORIZE_URL = 'https://auth.zapf.in/oauth/authorize'
ZAPFAUTH_ACCESS_TOKEN_URL = 'https://auth.zapf.in/oauth/token'
ZAPFAUTH_REQUEST_TOKEN_URL = None
ZAPFAUTH_ACCESS_TOKEN_METHOD = 'POST'
ZAPFAUTH_CONSUMER_KEY = 'a random string key'
ZAPFAUTH_CONSUMER_SECRET = 'a random string secret'
ZAPFAUTH_REVOKE_URL = 'https://auth.zapf.in/oauth/revoke'
ZAPFAUTH_LOGOUT_URL = 'https://auth.zapf.in/logout'
@staticmethod
def init_app(app):
pass
class DevelopmentConfig(Config):
SECRET_KEY = 'secrets'
PREFERRED_URL_SCHEME = 'http'
ZAPFAUTH_BASE_URL = 'http://test.auth.zapf.in/api/'
ZAPFAUTH_AUTHORIZE_URL = 'http://test.auth.zapf.in/oauth/authorize'
ZAPFAUTH_ACCESS_TOKEN_URL = 'http://test.auth.zapf.in/oauth/token'
DEBUG=True
@staticmethod
def init_app(app):
print("Development config")
import os
os.environ['OAUTHLIB_INSECURE_TRANSPORT'] = '1'
class ProductionConfig(Config):
LOGPATH='logs'
class TestingConfig(Config):
DEBUG=True
TESTING=True
FLASK_COVERAGE = 1
SECRET_KEY = 'secrets'
WTF_CSRF_ENABLED = False
config = {
'development': DevelopmentConfig,
'production': ProductionConfig,
'testing': TestingConfig,
'default': DevelopmentConfig
}