You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+10-12Lines changed: 10 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -40,19 +40,15 @@ If you are familiar with these frameworks, you will find it easy to understand a
40
40
## Installation
41
41
### Poetry Installation
42
42
For [Poetry](https://python-poetry.org/) usages
43
+
43
44
```shell
44
-
poetry add ellar[standard]
45
+
poetry add ellar-cli
45
46
```
46
47
47
48
### Pip Installation
48
49
For normal pip installation
49
50
```shell
50
-
pip install ellar[standard]
51
-
```
52
-
### NB:
53
-
Some shells may treat square braces (`[` and `]`) as special characters. If that's the case here, then use a quote around the characters to prevent unexpected shell expansion.
54
-
```shell
55
-
pip install "ellar[standard]"
51
+
pip install ellar-cli
56
52
```
57
53
58
54
## Create a project
@@ -234,7 +230,6 @@ Ellar is not aware of `CarModule` yet, so we need to add it to the `modules` lis
234
230
```python
235
231
from ellar.common import Module, exception_handler
236
232
from ellar.core import IHostContext, ModuleBase
237
-
from ellar.core.connection import Request
238
233
from ellar.core.response import JSONResponse, Response
239
234
240
235
from ellar.samples.modules import HomeModule
@@ -256,7 +251,7 @@ import os
256
251
257
252
from ellar.constants importELLAR_CONFIG_MODULE
258
253
from ellar.core.factory import AppFactory
259
-
from ellar.openapi import OpenAPIDocumentModule, OpenAPIDocumentBuilder
254
+
from ellar.openapi import OpenAPIDocumentModule, OpenAPIDocumentBuilder, SwaggerDocumentGenerator
Copy file name to clipboardExpand all lines: docs/caching.md
+65-22Lines changed: 65 additions & 22 deletions
Original file line number
Diff line number
Diff line change
@@ -7,21 +7,64 @@ By caching data in a faster, more local storage location, the system can quickly
7
7
In Ellar, we provided several cache backends interface that interacts with different cache types to assist in cache endpoint responses or other relevant data.
8
8
9
9
## Setting up the cache
10
-
It's very simple to set up cache in Ellar but the crucial part is picking the cache type that is suitable for your application because some cache type behave differently and perform better and faster than others.
10
+
It's very simple to set up cache in Ellar but the crucial part is picking the cache type that is suitable for your application
11
+
because some cache type behave differently and perform better and faster than others.
11
12
12
-
The configuration of your cache defined in `CACHES` variable in `config.py` file.
13
+
To set up cache, we need to use `CacheModule`. `CacheModule` provides two methods, `CacheModule.register_setup` and `CacheModule.setup`, for setting up `cache` in ellar applications.
13
14
14
-
```python
15
-
# project_name/config.py
15
+
=== "CacheModule Register Setup"
16
+
This setup method requires you to defined `CACHES` variable containing
17
+
key value pairs of cache backends in `config.py` file.
18
+
19
+
for example:
20
+
21
+
```python
22
+
# project_name/config.py
23
+
24
+
from ellar.core import ConfigDefaultTypesMixin
25
+
from ellar.cache.backends.local_cache import LocalMemCacheBackend
In CacheModule.`setup`, the `default` parameter must be provided and other cache
67
+
backends will be defined as keyword-arguments just like `local` and `others` incase you want to set up more than one cache backend.
25
68
26
69
### **Memcached**
27
70
[Memcached](https://memcached.org/) is an entirely memory-based cache server, originally developed to handle high loads at LiveJournal.com and subsequently open-sourced by Danga Interactive.
@@ -273,7 +316,7 @@ class DevelopmentConfig(ConfigDefaultTypesMixin):
273
316
'default': PyMemcacheCacheBackend(
274
317
servers=['127.0.0.1:11211'],
275
318
options={'default_noreply': True},
276
-
timeout=300,
319
+
ttl=300,
277
320
version=1,
278
321
key_prefix='project_name'
279
322
)
@@ -296,7 +339,7 @@ from ellar.cache.backends.local_cache import LocalMemCacheBackend
0 commit comments