Akron | ca9bd98 | 2016-12-06 16:59:57 +0100 | [diff] [blame] | 1 | __author__ = 'hanl' |
| 2 | |
| 3 | DEBUG = True |
| 4 | |
| 5 | QUERY_LANGUAGES = {"poliqarp": "Poliqarp", "cosmas2": "Cosmas 2", "annis": "ANNIS", |
| 6 | "cql": "CQL"} |
| 7 | |
| 8 | WTF_CSRF_ENABLED = True |
| 9 | SECRET_KEY = "nHim5JB-YqkX7sS55jayGBnga8WmqgpkzieGe8UhojE" |
| 10 | REMEMBER_COOKIE_NAME = "rememberMe" |
| 11 | |
| 12 | # RECAPTCHA_PUBLIC_KEY = "YOUR PUBLIC KEY" # https://www.google.com/recaptcha |
| 13 | # RECAPTCHA_PRIVATE_KEY = "YOUR PRIVATE KEY" # https://www.google.com/recaptcha |
| 14 | |
| 15 | # Oauth client data |
| 16 | OAUTH2_CLIENT_ID = "fCBbQkA3ZDBhMzc2Nw==" |
| 17 | OAUTH2_CLIENT_SECRET = "f58c361f7e8e07a05133322f6af6727440edcab7dbc02a49508c0168bd18c7ed" |
| 18 | OPENID_CONNECT_SCOPES = "openid profile" |
| 19 | API_SERVER = "http://localhost:7070/api/v0.1" |
| 20 | |
| 21 | # suggest authentication based on the available schema |
| 22 | AUTH_PROVIDER = "providers.CustomProvider" |
| 23 | |
| 24 | BABEL_DEFAULT_LOCALE = 'de' |
| 25 | |
| 26 | LANGUAGES = { |
| 27 | 'en': 'English', |
| 28 | 'de': 'Deutsch' |
| 29 | } |
| 30 | |
| 31 | ADMINS = {'OAuth2Provider': ('access_token', ['auth_token']), |
| 32 | 'CustomProvider': ('username', ['MichaelHanl', 'korap'])} |
| 33 | |
| 34 | |
| 35 | # email settings |
| 36 | # MAIL_SERVER : default 'localhost' |
| 37 | #MAIL_PORT : default 25 |
| 38 | #MAIL_USE_TLS : default False |
| 39 | #MAIL_USE_SSL : default False |
| 40 | #MAIL_USERNAME : default None |
| 41 | #MAIL_PASSWORD : default None |
| 42 | DEFAULT_MAIL_SENDER = "korap@ids-mannheim.de" |
| 43 | |
| 44 | |
| 45 | class URIBuilder(object): |
| 46 | def __init__(self, url=API_SERVER): |
| 47 | self.base = url |
| 48 | self.path = [] |
| 49 | |
| 50 | def addPath(self, path=None): |
| 51 | if path: |
| 52 | self.path.append(path) |
| 53 | return self |
| 54 | |
| 55 | def build(self): |
| 56 | end = self.base |
| 57 | if not end: |
| 58 | raise ValueError("no base URL set!") |
| 59 | for p in self.path: |
| 60 | if end.endswith("/"): |
| 61 | end += p |
| 62 | else: |
| 63 | end += "/" + p |
| 64 | return end |