Skip to content

Commit 0173c67

Browse files
committed
Doc Updates
1 parent 4fad78d commit 0173c67

File tree

1 file changed

+21
-13
lines changed

1 file changed

+21
-13
lines changed

docs/techniques/configurations.md

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -138,13 +138,17 @@ It defines a list of `IExceptionHandler` objects used in handling custom excepti
138138
### **STATIC_MOUNT_PATH**
139139
Default: `/static`
140140

141-
It configures the root path to get to static files. eg `http://localhost:8000/static/stylesheet.css`.
142-
And if for instance `STATIC_MOUNT_PATH`=`'/my-static'`, then the route becomes `http://localhost:8000/my-static/stylesheet.css`
141+
It configures the root path to serve static files.
142+
For example, if there is a `stylesheet.css` in a **static** folder, and `STATIC_MOUNT_PATH=/static`,
143+
`stylesheet.css` can be reached through the link
144+
`http://localhost:8000/static/stylesheet.css` assuming you are on local development server.
145+
146+
Also, if `STATIC_MOUNT_PATH=None`, static route handler would not be registered to application routes.
143147

144148
### **SERIALIZER_CUSTOM_ENCODER**
145-
Default: `ENCODERS_BY_TYPE` (`pydantic.json.ENCODERS_BY_TYPE`)
149+
Default: `ENCODERS_BY_TYPE` (`ellar.pydantic.ENCODERS_BY_TYPE`)
146150

147-
**SERIALIZER_CUSTOM_ENCODER** is a key-value pair of type and function. Default is a pydantic JSON encode type.
151+
**SERIALIZER_CUSTOM_ENCODER** is a key-value pair of a type and function. Default is a pydantic JSON encode type.
148152
It is used when serializing objects to JSON format.
149153

150154
### **DEFAULT_NOT_FOUND_HANDLER**
@@ -183,7 +187,8 @@ together instead of having a separate handler for `startup` and `shutdown` event
183187

184188
```python
185189
import contextlib
186-
from ellar.core import App, ConfigDefaultTypesMixin
190+
from ellar.core import ConfigDefaultTypesMixin
191+
from ellar.app import App
187192

188193

189194
@contextlib.asynccontextmanager
@@ -271,7 +276,7 @@ To apply these configurations without having to load everything, you have to pro
271276
belongs to ellar. For example,
272277

273278
```python
274-
from ellar.core.factory import AppFactory
279+
from ellar.app import AppFactory
275280
from .root_module import ApplicationModule
276281

277282
application = AppFactory.create_from_app_module(ApplicationModule, config_module=dict(
@@ -286,13 +291,16 @@ This will be applied to the configuration instance when the application is ready
286291
During application bootstrapping with `AppFactory`, you can define app configurations directly under `config_module` as a dict object as some below.
287292

288293
```python
289-
from ellar.core.factory import AppFactory
294+
from ellar.app import AppFactory
290295
from .root_module import ApplicationModule
291296

292-
application = AppFactory.create_from_app_module(ApplicationModule, config_module=dict(
293-
SECRET_KEY = "your-secret-key-changed",
294-
INJECTOR_AUTO_BIND = True,
295-
MIDDLEWARE=[],
296-
EXCEPTION_HANDLERS=[]
297-
))
297+
application = AppFactory.create_from_app_module(
298+
ApplicationModule,
299+
config_module=dict(
300+
SECRET_KEY = "your-secret-key-changed",
301+
INJECTOR_AUTO_BIND = True,
302+
MIDDLEWARE=[],
303+
EXCEPTION_HANDLERS=[]
304+
)
305+
)
298306
```

0 commit comments

Comments
 (0)