@@ -138,13 +138,17 @@ It defines a list of `IExceptionHandler` objects used in handling custom excepti
138
138
### ** STATIC_MOUNT_PATH**
139
139
Default: ` /static `
140
140
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.
143
147
144
148
### ** SERIALIZER_CUSTOM_ENCODER**
145
- Default: ` ENCODERS_BY_TYPE ` (` pydantic.json .ENCODERS_BY_TYPE` )
149
+ Default: ` ENCODERS_BY_TYPE ` (` ellar.pydantic .ENCODERS_BY_TYPE` )
146
150
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.
148
152
It is used when serializing objects to JSON format.
149
153
150
154
### ** DEFAULT_NOT_FOUND_HANDLER**
@@ -183,7 +187,8 @@ together instead of having a separate handler for `startup` and `shutdown` event
183
187
184
188
``` python
185
189
import contextlib
186
- from ellar.core import App, ConfigDefaultTypesMixin
190
+ from ellar.core import ConfigDefaultTypesMixin
191
+ from ellar.app import App
187
192
188
193
189
194
@contextlib.asynccontextmanager
@@ -271,7 +276,7 @@ To apply these configurations without having to load everything, you have to pro
271
276
belongs to ellar. For example,
272
277
273
278
``` python
274
- from ellar.core.factory import AppFactory
279
+ from ellar.app import AppFactory
275
280
from .root_module import ApplicationModule
276
281
277
282
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
286
291
During application bootstrapping with ` AppFactory ` , you can define app configurations directly under ` config_module ` as a dict object as some below.
287
292
288
293
``` python
289
- from ellar.core.factory import AppFactory
294
+ from ellar.app import AppFactory
290
295
from .root_module import ApplicationModule
291
296
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
+ )
298
306
```
0 commit comments