Set DEFAULT_PERMISSION_CLASSES for PDC.
See https://github.com/product-definition-center/product-definition-center/issues/221
This commit is contained in:
parent
c3bd96853a
commit
6b5c9d94dc
1 changed files with 24 additions and 41 deletions
|
@ -9,47 +9,30 @@
|
||||||
# NOTE: For developers or others who want to extend the default
|
# NOTE: For developers or others who want to extend the default
|
||||||
# settings, please remember to update your settings_local.py
|
# settings, please remember to update your settings_local.py
|
||||||
# when the items you extended got updated in settings.py.
|
# when the items you extended got updated in settings.py.
|
||||||
#
|
|
||||||
# Example 1: if you want to enable `debug_toolbar` and
|
REST_FRAMEWORK = {
|
||||||
# `django_extensions` in INSTALLED_APPS, please remember
|
'DEFAULT_AUTHENTICATION_CLASSES': (
|
||||||
# to also include all the other apps listed in the settings.py,
|
'pdc.apps.auth.authentication.TokenAuthenticationWithChangeSet',
|
||||||
# otherwise, the missed apps will not get installed.
|
'rest_framework.authentication.SessionAuthentication',
|
||||||
#
|
),
|
||||||
# INSTALLED_APPS = (
|
|
||||||
# ...
|
'DEFAULT_PERMISSION_CLASSES': [
|
||||||
#
|
'rest_framework.permissions.DjangoModelPermissionsOrAnonReadOnly',
|
||||||
# 'django_extensions',
|
],
|
||||||
# 'debug_toolbar',
|
|
||||||
# )
|
'DEFAULT_FILTER_BACKENDS': ('rest_framework.filters.DjangoFilterBackend',),
|
||||||
#
|
|
||||||
# Example 2: when you run PDC locally, you may not want to enable
|
'DEFAULT_METADATA_CLASS': 'contrib.bulk_operations.metadata.BulkMetadata',
|
||||||
# the permission check system of the `REST_FRAMEWORK`, to do
|
|
||||||
# this, just need to comment out the `DEFAULT_PERMISSION_CLASSES`
|
'DEFAULT_RENDERER_CLASSES': (
|
||||||
# section.
|
'rest_framework.renderers.JSONRenderer',
|
||||||
#
|
'pdc.apps.common.renderers.ReadOnlyBrowsableAPIRenderer',
|
||||||
# REST_FRAMEWORK = {
|
),
|
||||||
# 'DEFAULT_AUTHENTICATION_CLASSES': (
|
|
||||||
# 'pdc.apps.auth.authentication.TokenAuthenticationWithChangeSet',
|
'EXCEPTION_HANDLER': 'pdc.apps.common.handlers.exception_handler',
|
||||||
# 'rest_framework.authentication.SessionAuthentication',
|
|
||||||
# ),
|
'DEFAULT_PAGINATION_CLASS': 'pdc.apps.common.pagination.AutoDetectedPageNumberPagination',
|
||||||
#
|
}
|
||||||
# # 'DEFAULT_PERMISSION_CLASSES': [
|
|
||||||
# # 'rest_framework.permissions.DjangoModelPermissions'
|
|
||||||
# # ],
|
|
||||||
#
|
|
||||||
# 'DEFAULT_FILTER_BACKENDS': ('rest_framework.filters.DjangoFilterBackend',),
|
|
||||||
#
|
|
||||||
# 'DEFAULT_METADATA_CLASS': 'contrib.bulk_operations.metadata.BulkMetadata',
|
|
||||||
#
|
|
||||||
# 'DEFAULT_RENDERER_CLASSES': (
|
|
||||||
# 'rest_framework.renderers.JSONRenderer',
|
|
||||||
# 'pdc.apps.common.renderers.ReadOnlyBrowsableAPIRenderer',
|
|
||||||
# ),
|
|
||||||
#
|
|
||||||
# 'EXCEPTION_HANDLER': 'pdc.apps.common.handlers.exception_handler',
|
|
||||||
#
|
|
||||||
# 'DEFAULT_PAGINATION_CLASS': 'pdc.apps.common.pagination.AutoDetectedPageNumberPagination',
|
|
||||||
# }
|
|
||||||
|
|
||||||
|
|
||||||
import os.path
|
import os.path
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue