Skip to content

Releases: dymmond/lilya

Version 0.6.0

02 May 09:15
e14ec98
Compare
Choose a tag to compare

Fixed

  • add_arguments from BaseDirective to not raise NotImplementedError exception.

Version 0.5.0

23 Apr 16:56
894852e
Compare
Choose a tag to compare

Added

  • settings_module also supports import as string

Example

from lilya.apps import Lilya
from lilya.requests import Request
from lilya.routing import Path


async def home(): ...


app = Lilya(
    routes=[Path("/", handler=home)],
    settings_module="myapp.configs.settings.AppSettings",
)

Version 0.4.0

18 Apr 14:58
549e831
Compare
Choose a tag to compare

Added

  • encoders directly embed in any response. The encoders is a list of lilya.encoder.Encoder type
    of objects that can be passed directly into the response. SInce the responses can be independent ASGI applications,
    the encoders can be passed directly there.

Version 0.3.5

10 Apr 22:13
8fa223e
Compare
Choose a tag to compare

Changed

  • Documentation improvements.

Fixed

  • Typo in the create project directive urls file descripton.

Version 0.3.4

05 Apr 10:43
7c40230
Compare
Choose a tag to compare

Added

  • Extra validations to handle the events.

Version 0.3.3

04 Apr 14:51
9fc0c90
Compare
Choose a tag to compare

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

from dataclasses import dataclass

from lilya.apps import Lilya
from lilya.conf import settings
from lilya.conf.global_settings import Settings
from lilya.responses import Ok
from lilya.routing import Include, Path

async def home():
    title = getattr(settings, "title", "Lilya")
    return Ok({"title": title, "debug": settings.debug})


@dataclass
class NewSettings(Settings):
    title: str = "Settings being parsed by the middleware and make it app global"
    debug: bool = False


@dataclass
class NestedAppSettings(Settings):
    title: str = "Nested app title"
    debug: bool = True


app = Lilya(
    settings_module=NewSettings,
    routes=[
        Path("/home", handler=home),
        Include(
            "/child",
            app=Lilya(
                settings_module=NestedAppSettings,
                routes=[
                    Path("/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.

Version 0.3.2

03 Apr 12:43
da348ee
Compare
Choose a tag to compare

Fixed

  • Missing requirements needed for the pip install lilya[cli]

Version 0.3.1

02 Apr 16:07
673b227
Compare
Choose a tag to compare

Added

  • New await request.data() and await request.text() .
  • media to Request object returning a dict containing the content type media definitions in a dictionary
    like format.

Version 0.3.0

27 Mar 11:21
abfd313
Compare
Choose a tag to compare

Added

  • Allow Encoder and Transformer to be registered without forcing to be
    instances.

Changed

  • Add __slots__ to Request.

Version 0.2.3

12 Mar 16:34
1174228
Compare
Choose a tag to compare

Added

  • Alias Middleware to be imported from lilya.middleware.

Fixed

  • message in responses was not passing the proper headers.