Esmerald

Latest version: v3.6.7

Safety actively analyzes 714875 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 7 of 19

3.1.0

Added

- `settings_module` when passed in the instance of Esmerald will take precedence
over the global settings, removing the need of using constantly the `ESMERALD_SETTINGS_MODULE`.
- `ApplicationSettingsMiddleware` as internal that handles with the `settings_module` provided and maps
the context of the settings.

Example of the way the settings are evaluated

python
from esmerald import Esmerald, EsmeraldAPISettings, Gateway, Include, JSONResponse, get, settings


get()
async def home() -> JSONResponse:
return JSONResponse({"title": settings.title})


class NewSettings(EsmeraldAPISettings):
title: str = "Main app"


class NestedAppSettings(EsmeraldAPISettings):
title: str = "Nested app"


app = Esmerald(
settings_module=NewSettings,
routes=[
Gateway("/home", handler=home),
Include(
"/child",
app=Esmerald(
settings_module=NestedAppSettings,
routes=[
Gateway("/home", handler=home),
],
),
),
],
)


In the context of the `controller home`, based on the path being called, it should return the
corresponding value of the `title` according to the settings of the app that is included.

Changed

- `createapp` directive `views.py` file generated renamed to `controllers.py`.
- Make the `EsmeraldAPISettings` hashable.
- Remove `settings_config` in favor of the `settings_module`.
- Bump Lilya version to 0.3.3.
Fixed

- Documentation references. [PR 282](https://github.com/dymmond/esmerald/pull/282) by [DJWOMS](https://github.com/DJWOMS)

3.0.0

Changed

- Moved from beta v3 version to the official v3 of Esmerald fully supporting Lilya.

3.0.0beta2

Added

- Allow the use `from lilya.middleware import Middleware` as alternative to `DefineMiddleware`,

Changed

- Cleaned the `ServerErrorMiddleware` from the lilya import.

3.0.0beta1

!!! Warning
This is a major release and it will be under the the version `3` of Esmerald.
You should not be affected but in case you are, please report any issues
so we can correct it.

Added

- Support for `Lilya` and drop `Starlette`.

Changed

- `CSRFConfig` `cookie_secure` renamed to `secure`.
- `CSRFConfig` `httponly` renamed to `httponly`.
- `CSRFConfig` `cookie_samesite` renamed to `samesite`.
- `CSRFConfig` `cookie_domain` renamed to `domain`.
- `CSRFConfig` `cookie_secure` renamed to `secure`.
- Removed support for the `BasicMiddleware` as this can be imported from any other ASGI application.

Internal

In the past, `Middleware` was being used but with the introduction of Lilya, now is `DefineMiddleware` that
is applied.

python
from lilya.middleware import DefineMiddleware


- The `PlainTextResponse` was renamed to `PlainText`.

2.7.4

Fixed

- `WSGIMiddleware` optional was being called in the core middlewares.

2.7.3

Added

- Allowing `app` to load as a string as alternative to an object inside the Include

Changed

- Internal code for lazy objects.
- Make `a2wsgi` optional for `WSGIMiddleware`.
- `httpx` is now only a depedency for testing.
- Cleared some core dependencies.

Page 7 of 19

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.