|
8 | 8 | # Extra installed apps
|
9 | 9 | INSTALLED_APPS += (
|
10 | 10 | # any 3rd party apps
|
11 |
| - 'rest_framework', |
12 |
| - 'rest_framework_gis', |
13 |
| - 'rest_framework.authtoken', |
14 |
| - 'social_django', |
| 11 | + "rest_framework", |
| 12 | + "rest_framework_gis", |
| 13 | + "rest_framework.authtoken", |
| 14 | + "social_django", |
15 | 15 | )
|
16 | 16 |
|
17 | 17 | # 3rd party specific app settings
|
18 | 18 | OAUTH2_PROVIDER = {
|
19 |
| - 'ACCESS_TOKEN_EXPIRE_SECONDS': 10 * 365 * 24 * 60 * 60, |
| 19 | + "ACCESS_TOKEN_EXPIRE_SECONDS": 10 * 365 * 24 * 60 * 60, |
20 | 20 | }
|
21 | 21 |
|
22 | 22 | REST_FRAMEWORK = {
|
23 |
| - 'DEFAULT_FILTER_BACKENDS': ('rest_framework.filters.SearchFilter', |
24 |
| - 'rest_framework.filters.OrderingFilter'), |
25 |
| - 'DEFAULT_AUTHENTICATION_CLASSES': ('rest_framework.authentication.TokenAuthentication', |
26 |
| - 'oauth2_provider.contrib.rest_framework.OAuth2Authentication', |
27 |
| - 'rest_framework.authentication.SessionAuthentication',), |
28 |
| - 'DEFAULT_PERMISSION_CLASSES': ('rest_framework.permissions.IsAuthenticated',), |
29 |
| - 'DEFAULT_RENDERER_CLASSES': ( |
30 |
| - 'rest_framework.renderers.JSONRenderer', |
31 |
| - 'api.renderers.HOTExportApiRenderer', |
| 23 | + "DEFAULT_FILTER_BACKENDS": ( |
| 24 | + "rest_framework.filters.SearchFilter", |
| 25 | + "rest_framework.filters.OrderingFilter", |
32 | 26 | ),
|
33 |
| - 'DEFAULT_VERSIONING_CLASS': 'rest_framework.versioning.AcceptHeaderVersioning', |
34 |
| - 'DEFAULT_VERSION': '1.0', |
35 |
| - 'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.LimitOffsetPagination', |
36 |
| - 'PAGE_SIZE': 20 |
| 27 | + "DEFAULT_AUTHENTICATION_CLASSES": ( |
| 28 | + "rest_framework.authentication.TokenAuthentication", |
| 29 | + "oauth2_provider.contrib.rest_framework.OAuth2Authentication", |
| 30 | + "rest_framework.authentication.SessionAuthentication", |
| 31 | + ), |
| 32 | + "DEFAULT_PERMISSION_CLASSES": ("rest_framework.permissions.IsAuthenticated",), |
| 33 | + "DEFAULT_RENDERER_CLASSES": ( |
| 34 | + "rest_framework.renderers.JSONRenderer", |
| 35 | + "api.renderers.HOTExportApiRenderer", |
| 36 | + ), |
| 37 | + "DEFAULT_VERSIONING_CLASS": "rest_framework.versioning.AcceptHeaderVersioning", |
| 38 | + "DEFAULT_VERSION": "1.0", |
| 39 | + "DEFAULT_PAGINATION_CLASS": "rest_framework.pagination.LimitOffsetPagination", |
| 40 | + "PAGE_SIZE": 20, |
37 | 41 | }
|
38 | 42 |
|
| 43 | + |
39 | 44 | # OAuth login settings
|
40 |
| -SOCIAL_AUTH_OPENSTREETMAP_LOGIN_URL = '/osm/login/' |
41 |
| -SOCIAL_AUTH_OPENSTREETMAP_KEY = os.getenv('OSM_API_KEY') |
42 |
| -SOCIAL_AUTH_OPENSTREETMAP_SECRET = os.getenv('OSM_API_SECRET') |
43 |
| -SOCIAL_AUTH_LOGIN_REDIRECT_URL = '/' |
44 |
| -SOCIAL_AUTH_LOGIN_ERROR_URL = '/osm/error' |
45 |
| -SOCIAL_AUTH_URL_NAMESPACE = 'osm' |
46 |
| -SOCIAL_AUTH_ADMIN_USER_SEARCH_FIELDS = ['username', 'first_name', 'email'] |
| 45 | +SOCIAL_AUTH_OPENSTREETMAP_LOGIN_URL = "/osm/login/" |
| 46 | +SOCIAL_AUTH_OPENSTREETMAP_OAUTH2_KEY = os.getenv("OSM_API_KEY") |
| 47 | +SOCIAL_AUTH_OPENSTREETMAP_OAUTH2_SECRET = os.getenv("OSM_API_SECRET") |
| 48 | +SOCIAL_AUTH_LOGIN_REDIRECT_URL = "/" |
| 49 | +SOCIAL_AUTH_LOGIN_ERROR_URL = "/osm/error" |
| 50 | +SOCIAL_AUTH_URL_NAMESPACE = "osm" |
| 51 | +SOCIAL_AUTH_ADMIN_USER_SEARCH_FIELDS = ["username", "first_name", "email"] |
47 | 52 | SOCIAL_AUTH_FORCE_EMAIL_VALIDATION = True
|
48 |
| -SOCIAL_AUTH_EMAIL_VALIDATION_FUNCTION = 'ui.pipeline.email_validation' |
49 |
| -SOCIAL_AUTH_EMAIL_VALIDATION_URL = '/osm/email_verify_sent/' |
| 53 | +SOCIAL_AUTH_EMAIL_VALIDATION_FUNCTION = "ui.pipeline.email_validation" |
| 54 | +SOCIAL_AUTH_EMAIL_VALIDATION_URL = "/osm/email_verify_sent/" |
50 | 55 |
|
51 | 56 | SOCIAL_AUTH_PIPELINE = (
|
52 |
| - 'social_core.pipeline.social_auth.social_details', |
53 |
| - 'social_core.pipeline.social_auth.social_uid', |
54 |
| - 'social_core.pipeline.social_auth.auth_allowed', |
55 |
| - 'social_core.pipeline.social_auth.social_user', |
56 |
| - 'social_core.pipeline.user.get_username', |
57 |
| - 'ui.pipeline.require_email', |
58 |
| - 'social_core.pipeline.mail.mail_validation', |
59 |
| - 'social_core.pipeline.social_auth.associate_by_email', |
60 |
| - 'social_core.pipeline.user.create_user', |
61 |
| - 'social_core.pipeline.social_auth.associate_user', |
62 |
| - 'social_core.pipeline.debug.debug', |
63 |
| - 'social_core.pipeline.social_auth.load_extra_data', |
64 |
| - 'social_core.pipeline.user.user_details' |
| 57 | + "social_core.pipeline.social_auth.social_details", |
| 58 | + "social_core.pipeline.social_auth.social_uid", |
| 59 | + "social_core.pipeline.social_auth.auth_allowed", |
| 60 | + "social_core.pipeline.social_auth.social_user", |
| 61 | + "social_core.pipeline.user.get_username", |
| 62 | + "ui.pipeline.require_email", |
| 63 | + "social_core.pipeline.mail.mail_validation", |
| 64 | + "social_core.pipeline.social_auth.associate_by_email", |
| 65 | + "social_core.pipeline.user.create_user", |
| 66 | + "social_core.pipeline.social_auth.associate_user", |
| 67 | + "social_core.pipeline.debug.debug", |
| 68 | + "social_core.pipeline.social_auth.load_extra_data", |
| 69 | + "social_core.pipeline.user.user_details", |
65 | 70 | )
|
0 commit comments