Releases: alorence/django-modern-rpc
Releases · alorence/django-modern-rpc
v2.0.0 (2025-11-10)
Improvements
- The new API, heavily inspired from tools like FastAPI or django-ninja, encapsulate the procedures registration in a
dedicatedRpcServerinstance. This removes the need to lookup modules based onsettings.MODERNRPC_METHODS_MODULES
value, somodernrpcdoes not need to be added to settings.INSTALLED_APPS anymore. RpcNamespacewere added to provide a better organization of procedures. Each one can be registered in a
previously definedRpcServer.- It is now possible to register
asyncprocedures. Both sync (legacy) and async procedures are served by the default
view (synchronous) - For improved performances with
asyncprocedures, anasyncview has been added and can be used as a replacement to
expose procedures. Theasync_viewcan serve both sync and async procedures. - Error handling has been improved, allowing executing a callback function when an exception is caught and before an
RPC error response is built. - The authentication process has been improved. Multiple callbacks can be configured at server-level, namespace-level
or directly on a specific remote procedure. - It is now possible to configure different backends to deserialize XML-RPC and JSON-RPC requests and to serialize
XML-RPC and JSON-RPC responses. Alternative backends may provide more features, configuration options, specific types
support or better performances.
Breaking Changes
- Complete architecture redesign: The library now uses a server-based approach instead of entry points
- Removed the
RPCEntryPointclass-based view in favor of the new function based views provided byRpcServerclass - Removed automatic procedure registration via
MODERNRPC_METHODS_MODULESsetting - Removed HTML documentation generation through entry points
- Changed the way procedures access request context, now using the
context_targetparameter - Some settings were removed:
- MODERNRPC_METHODS_MODULES
- MODERNRPC_LOG_EXCEPTIONS
- MODERNRPC_DEFAULT_ENTRYPOINT_NAME
- MODERNRPC_JSON_DECODER
- MODERNRPC_JSON_ENCODER
- MODERNRPC_XMLRPC_USE_BUILTIN_TYPES
- MODERNRPC_XMLRPC_ALLOW_NONE
- MODERNRPC_XMLRPC_DEFAULT_ENCODING
Misc
- Added support for Django 5.2 and 6.0
- Added support for Python 3.14
- Dropped support of Django < 3.2
- Dropped support of Python 3.7
v1.1.0 (2025-01-01)
Improvements
- JSON-RPC handler now performs request validation in a dedicated method, allowing better customization of that part.
Inspired by #73, thanks to @hwalinga
Fixes
- JSON-RPC handler now correctly checks type of request "id" field, according to the
specification (#72). Thanks to @moonburnt - Fixed docstring parser to allow empty or multi-line arg description
- Fixed registration of methods with same names under different entry points (#74). Thanks to @hwalinga
Misc
- Added support for Django 5.1
- Added support for Python 3.13
- Dropped support of Django 2.1
v1.0.3 (2024-02-29)
Improvements
- When package
defusedxmlis installed in the same environment, builtinxmlrpc.clientmodule is patched to reduce
the risk of various XML payload based attacks on the server
Fixes
- Fix dependency to
packagingintroduced in previous release.
Misc
v1.0.2 (2023-11-27)
Fixes
- When request is received with an invalid Content-Type (or missing one), the error response is now returned with a
"text/plain" Content-Type header.
Misc
- Dropped support of python 3.5 and 3.6
- Added support for python 3.12 and Django 4.2
v1.0.1 (2023-01-26)
v1.0.0 (2023-01-03)
After months of work, the 1.0 milestone is a major refactoring of the library. Many parts of the project have been
modernized to improve readability and robustness, and a few issues were fixed.
Improvements
- Type hinting is now supported in RPC methods. Auto-generated documentation will use it when it is defined.
Old-style "doctypes" are still supported. - Dependency to
sixhave been completely removed
Breaking Changes
- When an authentication error is raised, the returned status code is now 200 instead of 403 for consistency with
batch and system.multicall requests (#35) - Django < 2.1 and Python < 3.5 support have been dropped.
Other API changes
- A new
modernrpc.core.Protocolenum has been introduced to enforce correct protocol value when needed. (#29, #30).
This new class replacesmodernrpc.core.JSONRPC_PROTOCOLandmodernrpc.core.XMLRPC_PROTOCOLbut aliases were
created for backward compatibility. RPCUnknownMethodexception has been renamed toRPCMethodNotFound. An alias has been created
for backward compatibility
Fixes
- Initialization process updated: exceptions are now raised on startup for invalid RPC modules. In addition, Django
check system is used to notify common errors. This was requested multiple times (#2, #13, #34). - JSON-RPC notification behavior has been fixed to respect standard. Requests without
idare handled as
notifications but requests with nullidare considered invalid and will return an error - Batch request behavior has been fixed when one or more results failed to be serialized
- Builtin
system.methodSignaturebehavior have been updated to respect standard. It now returns a list of
list and unknown types are returned as "undef" (see http://xmlrpc-c.sourceforge.net/introspection.html)
Misc
- Added support for Python 3.9, 3.10 and 3.11
- Added support for Django 3.2, 4.0 and 4.1
- Documentation tree was completely reworked for clarity and simplicity. A new theme (Book) is now used to improve
readability. See https://django-modern-rpc.rtfd.io. - Poetry is now used to configure project dependencies and build distributions. The new
pyproject.tomlfile
replacessetup.py,setup.cfg,MANIFEST.inandrequirements.txtto centralize all dependencies,
external tools settings (pytest, flake8, etc.) and packaging configuration - Black is now used to automatically format code
- Mypy is now used to verify type hints consistency
- Tox configuration now includes pylama, mypy, pylint and black environments
- All tests have been rewritten to have a strong separation between unit and functional tests. Test classes where
created to group tests by similarities. Many fixtures have been added, with more parameterization, resulting in
about 350 tests executed covering more than 95% of the code.
v1.0.0 alpha4 (2022-11-29)
Updated test matrix and fixed #48 (thanks to @sean-wallace)
See changelog for details.
v1.0.0 alpha3 (2022-06-13)
See changelog for details.
v1.0.0 alpha2 (2022-05-22)
See changelog for details.
v1.0.0 alpha1 (2022-03-03)
First alpha before 1.0.0.
See changelog for details.