django_socio_grpc.settings
Settings for gRPC framework are all namespaced in the GRPC_FRAMEWORK setting.
For example your project’s settings.py file might look like this:
GRPC_FRAMEWORK = { ‘ROOT_HANDLERS_HOOK’: ‘path.to.my.custom_grpc_handlers’,
'SERVER_INTERCEPTORS': [Interceptor1(), Interceptor2()],
'DEFAULT_FILTER_BACKENDS': ['django_filters.rest_framework.DjangoFilterBackend'],
# default pagination class
'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.Pagenumberpagination'
'DEFAULT_AUTHENTICATION_CLASSES': ['path.to.AuthenticationClass'],
'DEFAULT_PERMISSION_CLASSES': ['path.to.DefaultPermissionClass'],
'SEPARATE_READ_WRITE_MODEL': True,
'IGNORE_LOG_FOR_ACTION': ['Service1.Action1', 'Service1.Action1'],
'ROOT_GRPC_FOLDER': 'my_grpc_folder'
"LOG_EXTRA_CONTEXT_FUNCTION": 'django_socio_grpc.log.default_get_log_extra_context'
}
This module provides the grpc_setting object, that is used to access
gRPC framework settings, checking for user settings first, then falling
back to the defaults.
Module Contents
Classes
A settings object that allows gRPC Framework settings to be accessed as properties. For example: |
Functions
If the given setting is a string import notation, then perform the necessary import or imports. |
|
Attempt to import a class from a string representation. |
|
Data
API
- django_socio_grpc.settings.__all__
[‘grpc_settings’]
- django_socio_grpc.settings.DEFAULTS
None
- django_socio_grpc.settings.IMPORT_STRINGS
[‘ROOT_HANDLERS_HOOK’, ‘DEFAULT_AUTHENTICATION_CLASSES’, ‘DEFAULT_PERMISSION_CLASSES’, ‘DEFAULT_PAGI…
- django_socio_grpc.settings.perform_import(val, setting_name)
If the given setting is a string import notation, then perform the necessary import or imports.
- django_socio_grpc.settings.import_from_string(val, setting_name)
Attempt to import a class from a string representation.
- class django_socio_grpc.settings.GRPCSettings(user_settings=None, defaults=None, import_strings=None)
A settings object that allows gRPC Framework settings to be accessed as properties. For example:
from django_socio_grpc.settings import grpc_settings print(grpc_settings.ROOT_HANDLERS_HOOK)
Any setting with string import paths will be automatically resolved and return the class, rather than the string literal.
Initialization
- property user_settings
- __getattr__(attr)
- reload()
- django_socio_grpc.settings.grpc_settings
None
- django_socio_grpc.settings.reload_grpc_settings(*args, **kwargs)