If you don’t use any of these frameworks, ignore this page - the core
NexusClient / AsyncNexusClient work everywhere.
Django
Install with the extra:settings.py:
NEXUS_BASE_URL falls back to WESTYX_SERVICE_ENDPOINT; NEXUS_WIF takes a WIFConfig or a mapping of its fields ({"enabled": True, "provider": "kubernetes"}). With neither NEXUS_API_KEY nor NEXUS_WIF the adapter uses Workload Identity Federation with the default provider, which finds the session westyx dev setup wrote - so under westyx dev run it needs no Nexus settings at all.
The AppConfig.ready() hook performs the blocking initial sync at Django startup, so by the time any view is called the cache is populated.
views.py:
atexit).
FastAPI
Install with the extra:attach_nexus lifespan helper:
get_nexus is a standard FastAPI dependency - inject it into any handler.
Flask
Install with the extra:- One-shot:
NexusExtension(app)- create at module level alongside the app - Factory:
ext = NexusExtension(); ext.init_app(app)- for the application-factory pattern
atexit).
Logging
The Django and Flask adapters log throughStdlibNexusLogger() - the westyx_nexus logger - unless
NEXUS_LOGGER names another, and FastAPI’s attach_nexus takes whatever logger the NexusConfig
carries, the same logger by default. So the SDK’s records, the
startup summary among them, appear wherever your
application’s logging configuration sends westyx_nexus at INFO and above.
Framework settings come from the environment, not from Nexus
DJANGO_SETTINGS_MODULE and the settings Flask reads from its environment are read when the
framework starts, before the Nexus integration loads, so a Nexus config of that name changes
nothing. Set them in the deployment.
Manual (no adapter)
If you don’t use any of the supported frameworks (or you’re using one in a way the adapter doesn’t fit), you can always instantiate the client directly:nexus.close() on shutdown (signal handler, atexit, or with block).