API Documentation¶
Optional Settings¶
The following optional settings can go into settings.py to change the
functionality of RPC4Django
-
RPC4DJANGO_LOG_REQUESTS_RESPONSES¶ By default RPC4Django will log (using the python logging module) all requests and responses. This can be disabled by setting this to
False.
-
RPC4DJANGO_RESTRICT_INTROSPECTION¶ By default RPC4Django registers the standard XMLRPC and JSONRPC introspection functions. This can be disabled by setting this to
True.
-
RPC4DJANGO_RESTRICT_JSONRPC¶ If
True, RPC4Django will never serve a JSONRPC request. Instead, either XMLRPC will be tried or status code 404 will be returned. Defaults toFalse.
-
RPC4DJANGO_RESTRICT_XMLRPC¶ If
True, RPC4Django will never serve an XMLRPC request. Instead, either JSONRPC will be tried or status code 404 will be returned. Defaults toFalse.
-
RPC4DJANGO_RESTRICT_METHOD_SUMMARY¶ If
True, status code 404 will be returned instead of serving the method summary as a response to a GET request. Defaults toFalse.
-
RPC4DJANGO_RESTRICT_RPCTEST¶ If
True, the method summary will not allow testing via JSONRPC from the generated method summary page. Defaults toFalse
-
RPC4DJANGO_RESTRICT_REST¶ If
True, RPC4Django does not attempt to convert any of the method summary docstrings to restructured text. Defaults toFalse.
-
RPC4DJANGO_RESTRICT_OOTB_AUTH¶ If
False, enables out of the box authentication via the RPC methodssystem.loginandsystem.logout. Out of the box authentication should NOT be considered secure when used without SSL or TLS. Defaults toTrue.
-
RPC4DJANGO_HTTP_ACCESS_CREDENTIALS¶ If
True, RPC4Django will respond to OPTIONS requests with the HTTP headerAccess-Control-Allow-Credentialsset to the given value. This pertains to allowing cross site requests with cookies. See the Mozilla documentation on requests with credentials for more details. Defaults toFalse.
-
RPC4DJANGO_HTTP_ACCESS_ALLOW_ORIGIN¶ RPC4Django will respond to OPTIONS requests with the HTTP header
Access-Control-Allow-Originset to the given value. This pertains to allowing cross site requests. See the Mozilla documentation on preflighted requests for more details. Defaults to the empty string.
-
RPC4DJANGO_JSON_ENCODER¶ Subclass of
rpc4django.jsonrpcdispatcher.json.JSONEncoderor string pointing to the subclass. It can be used to serialize objects that can’t otherwise be serialized. Defaults todjango.core.serializers.json.DjangoJSONEncoder.
-
RPC4DJANGO_XMLRPC_USE_DATETIME¶ If
True, ate/time values to be presented as datetime.datetime objects object instead of XMLRPC DateTime. Defaults toTrue.
-
RPC4DJANGO_XMLRPC_USE_BUILTIN¶ If
True, date/time values to be presented as datetime.datetime objects and binary data to be presented as bytes objects. Defaults toTrue.