API
This commit is contained in:
parent
318e81d149
commit
f4a665cb7f
4 changed files with 43 additions and 0 deletions
|
|
@ -50,6 +50,8 @@ INSTALLED_APPS = [
|
|||
'django.contrib.sites',
|
||||
'django.contrib.messages',
|
||||
'django.contrib.staticfiles',
|
||||
# API
|
||||
'rest_framework',
|
||||
|
||||
# Note apps
|
||||
'activity',
|
||||
|
|
@ -117,6 +119,14 @@ AUTHENTICATION_BACKENDS = (
|
|||
'guardian.backends.ObjectPermissionBackend',
|
||||
)
|
||||
|
||||
REST_FRAMEWORK = {
|
||||
# Use Django's standard `django.contrib.auth` permissions,
|
||||
# or allow read-only access for unauthenticated users.
|
||||
'DEFAULT_PERMISSION_CLASSES': [
|
||||
'rest_framework.permissions.DjangoModelPermissionsOrAnonReadOnly'
|
||||
]
|
||||
}
|
||||
|
||||
ANONYMOUS_USER_NAME = None # Disable guardian anonymous user
|
||||
|
||||
GUARDIAN_GET_CONTENT_TYPE = 'polymorphic.contrib.guardian.get_polymorphic_base_content_type'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue