Esmerald framework - Highly scalable, performant, easy to learn, easy to code and for every sizeable and complex application
MIT License
Bot releases are hidden (Show)
Published by tarsil 6 months ago
hatch
and removed the need for a Makefile
.WSGIMiddleware
is now pointing to Lilya.Published by tarsil 6 months ago
typing_extensions
.Published by tarsil 6 months ago
Published by tarsil 7 months ago
settings_module
when passed in the instance of Esmerald will take precedenceESMERALD_SETTINGS_MODULE
.ApplicationSettingsMiddleware
as internal that handles with the settings_module
provided and mapsfrom 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.
createapp
directive views.py
file generated renamed to controllers.py
.EsmeraldAPISettings
hashable.settings_config
in favor of the settings_module
.Published by tarsil 7 months ago
Published by tarsil 7 months ago
from lilya.middleware import Middleware
as alternative to DefineMiddleware
,ServerErrorMiddleware
from the lilya import.Published by tarsil 7 months ago
!!! 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.
Lilya
and drop Starlette
.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
.BasicMiddleware
as this can be imported from any other ASGI application.In the past, Middleware
was being used but with the introduction of Lilya, now is DefineMiddleware
that
is applied.
from lilya.middleware import DefineMiddleware
PlainTextResponse
was renamed to PlainText
.Published by tarsil 8 months ago
WSGIMiddleware
optional was being called in the core middlewares.Published by tarsil 8 months ago
app
to load as a string as alternative to an object inside the Includea2wsgi
optional for WSGIMiddleware
.httpx
is now only a depedency for testing.Published by tarsil 9 months ago
Published by tarsil 9 months ago
settings_module
as replacement for settings_config
.settings_config
in favour of settings_module
parameter.esmerald createproject
in the tests.tags=None
.create_client
.Published by tarsil 9 months ago
Token.decode()
is now a classmethod
. This allows to subclass the Token
and add extra fields into the modelencode()
with extra claims. This can be useful for situations like claiming a refresh
or access
token.Published by tarsil 9 months ago
requirements
to the createproject
directive generating the minimum requirementsBaseAuthentication
for self.app
when its of the type of HTTPHandler and WebSocketHandler.Published by tarsil 9 months ago
Middleware
object.Include
to be compliant with the ASGI spec.Published by tarsil 11 months ago
contact
it was not parsing properly on transformation.include
attribute from Param
(base) and call include_in_schema
.nest_asyncio
dependency when using esmerald shell
.Published by tarsil 11 months ago
0.32.0.post1
Published by tarsil 11 months ago
model_dump
of pydantic models in the responses.orjson
for generic response parsing.Published by tarsil 12 months ago
msgspec
response example.data
. This aims!!! Note
Esmerald is not fully tight with Pydantic which means it's more flexible and extendible and allows more versatility.
random
for the secrets in favour of the secrets
library instead.Published by tarsil 12 months ago
Middleware
as an independent ASGI app on an Include
level.!!! Warning
This was supposed to go in the release 2.3.0 but it was not merged on time to make the
release.
Published by tarsil 12 months ago
settings
in case of wanting toOpenAPIConfig
is the!!! Warning
This is a breaking change. The functionality itself still works as it is supposed to but from now on
instead of passing via Esmerald instance, you need to pass the variables via OpenAPIConfig.
object instead.
Include
, Gateway
, or any other level,Middleware
on levels treating each level as an independent ASGI app.