root / snf-astakos-app / astakos / oa2 / settings.py @ 2f8a7c0e
History | View | Annotate | Download (741 Bytes)
1 |
from django.conf import settings |
---|---|
2 |
|
3 |
|
4 |
def get_setting(key, default): |
5 |
return getattr(settings, 'OA2_%s' % key, default) |
6 |
|
7 |
USER_MODEL = get_setting('USER_MODEL', 'auth.User') |
8 |
|
9 |
ENDPOINT_PREFIX = get_setting('ENDPOINT_PREFIX', 'oa2/') |
10 |
|
11 |
TOKEN_ENDPOINT = get_setting('TOKEN_ENDPOINT', 'token/') |
12 |
|
13 |
AUTHORIZATION_ENDPOINT = get_setting('AUTHORIZATION_ENDPOINT', 'auth/') |
14 |
|
15 |
# Set the length of newly created authorization codes to 60 characters
|
16 |
AUTHORIZATION_CODE_LENGTH = get_setting('AUTHORIZATION_CODE_LENGTH', 60) |
17 |
|
18 |
# Set the length of newly created access tokens to 30 characters
|
19 |
TOKEN_LENGTH = get_setting('TOKEN_LENGTH', 30) |
20 |
|
21 |
# Set the expiration time of newly created access tokens to 20 seconds
|
22 |
TOKEN_EXPIRES = get_setting('TOKEN_EXPIRES', 20) |