-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.py
21 lines (16 loc) · 618 Bytes
/
app.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
from starlite import Starlite, CacheConfig, TemplateConfig
from starlite.cache.redis_cache_backend import (
RedisCacheBackendConfig,
RedisCacheBackend,
)
from starlite.contrib.jinja import JinjaTemplateEngine
from lib.settings import redis
from routes import routes
config = RedisCacheBackendConfig(url=redis.URL, port=6379, db=0)
redis_backend = RedisCacheBackend(config=config)
cache_config = CacheConfig(backend=redis_backend)
app = Starlite(
route_handlers=routes.root_router,
cache_config=cache_config,
template_config=TemplateConfig(directory="templates", engine=JinjaTemplateEngine),
)