@@ -10,8 +10,7 @@ The path can be modified by providing a new value for the `STATIC_MOUNT_PATH` co
10
10
11
11
1 . In your config file, define ` STATIC_MOUNT_PATH ` , for example:
12
12
``` python
13
-
14
- class Config :
13
+ class Config :
15
14
STATIC_MOUNT_PATH = ' /static'
16
15
```
17
16
@@ -38,19 +37,19 @@ This allows us to keep all of the static files related to the dogs module organi
38
37
Next, we tell ` DogModule ` about our static folder.
39
38
40
39
``` python
41
- # project_name/apps/dogs /module.py
40
+ # project_name/apps/car /module.py
42
41
43
42
from ellar.common import Module
44
43
from ellar.core import ModuleBase
45
44
from ellar.di import Container
46
45
47
- from .controllers import DogsController
46
+ from .controllers import CarController
48
47
49
48
50
49
@Module (
51
- controllers = [DogsController ], static_folder = ' my_static'
50
+ controllers = [CarController ], static_folder = ' my_static'
52
51
)
53
- class DogsModule (ModuleBase ):
52
+ class CarModule (ModuleBase ):
54
53
def register_providers (self , container : Container) -> None :
55
54
# for more complicated provider registrations
56
55
# container.register_instance(...)
@@ -64,7 +63,7 @@ it is also possible to manually specify additional static directories that are n
64
63
These variables allow for even more flexibility in organizing and managing static files in a project.
65
64
These directories will be served by the StaticFiles ASGI class along with the module-scoped static files.
66
65
67
- ### ` STATIC_DIRECTORIES `
66
+ ### ** ` STATIC_DIRECTORIES ` **
68
67
` STATIC_DIRECTORIES ` variable is a list of directories within the project that contain static files.
69
68
These directories are not necessarily scoped to a specific module and can be used to serve static files from any location within the project.
70
69
These directories can be added to the ` STATIC_DIRECTORIES ` list in the application's configuration.
@@ -73,7 +72,7 @@ These directories can be added to the `STATIC_DIRECTORIES` list in the applicati
73
72
STATIC_DIRECTORIES = [' project_name/static-files' , ' project_name/path/to/static/files' ]
74
73
```
75
74
76
- ### ` STATIC_FOLDER_PACKAGES `
75
+ ### ** ` STATIC_FOLDER_PACKAGES ` **
77
76
` STATIC_FOLDER_PACKAGES ` variable is a list of tuples that contain python packages that hold some static files.
78
77
These packages should have a ` static ` folder and the ** package name** should be passed as tuple ` (package_name, package_path) ` ,
79
78
** package_path** is the relative path of static folder.
0 commit comments