Coverage for conf/settings/oauth2.py: 85%
9 statements
« prev ^ index » next coverage.py v7.15.2, created at 2026-10-07 06:14 +0000
« prev ^ index » next coverage.py v7.15.2, created at 2026-10-07 06:14 +0000
1from decouple import config
3from conf.settings.base import INSTALLED_APPS, MIDDLEWARE
6if "oauth2_provider" not in INSTALLED_APPS: 6 ↛ 9line 6 didn't jump to line 9 because the condition on line 6 was always true
7 INSTALLED_APPS.append("oauth2_provider")
9middleware = "oauth2_provider.middleware.OAuth2TokenMiddleware"
10if middleware not in MIDDLEWARE: 10 ↛ 13line 10 didn't jump to line 13 because the condition on line 10 was always true
11 MIDDLEWARE.append(middleware)
13OAUTH2_PROVIDER = {
14 "SCOPES": {
15 "read": "Read scope",
16 "write": "Write scope",
17 },
18 "ACCESS_TOKEN_EXPIRE_SECONDS": config(
19 "ACCESS_TOKEN_EXPIRE_SECONDS", default=3600 * 12, cast=int
20 ),
21}
23OAUTH2_PROVIDER_APPLICATION_MODEL = "api.ThrottledApplication"