diff --git a/debian/debian_config_common.py b/debian/debian_config_common.py index b5dbcd3..1c98a83 100644 --- a/debian/debian_config_common.py +++ b/debian/debian_config_common.py @@ -393,14 +393,17 @@ BROKER_TASK_EXPIRES = 600 STATICS_HASH_COUNTER = '/var/lib/publik/statics-counter' -# Django Rest Framework: allow only Publik-signed URLs +# Django Rest Framework: allow Publik-signed URLs and APIClient if 'rest_framework' in INSTALLED_APPS: if 'REST_FRAMEWORK' not in globals(): REST_FRAMEWORK = {} - REST_FRAMEWORK['DEFAULT_AUTHENTICATION_CLASSES'] = ( - 'hobo.rest_authentication.PublikAuthentication', - 'hobo.rest_authentication.APIClientAuthentication', - ) + if 'authentic2' not in INSTALLED_APPS: + REST_FRAMEWORK['DEFAULT_AUTHENTICATION_CLASSES'] = ( + 'hobo.rest_authentication.PublikAuthentication', + 'hobo.rest_authentication.APIClientAuthentication', + ) + else: + REST_FRAMEWORK['DEFAULT_AUTHENTICATION_CLASSES'] = ('hobo.rest_authentication.PublikAuthentication',) REST_FRAMEWORK['DEFAULT_PERMISSION_CLASSES'] = ('rest_framework.permissions.IsAuthenticated',) REST_FRAMEWORK['DEFAULT_RENDERER_CLASSES'] = ('rest_framework.renderers.JSONRenderer',)