|
5 | 5 | from .websocket_consumer import IdomAsyncWebSocketConsumer |
6 | 6 |
|
7 | 7 |
|
8 | | -def idom_websocket_path(*args, **kwargs): |
9 | | - """Return a URL resolver for :class:`IdomAsyncWebSocketConsumer` |
| 8 | +IDOM_WEBSOCKET_PATH = path( |
| 9 | + IDOM_WEBSOCKET_URL + "<view_id>/", IdomAsyncWebSocketConsumer.as_asgi() |
| 10 | +) |
| 11 | +"""A URL resolver for :class:`IdomAsyncWebSocketConsumer` |
10 | 12 |
|
11 | | - While this is relatively uncommon in most Django apps, because the URL of the |
12 | | - websocket must be defined by the setting ``IDOM_WEBSOCKET_URL``. There's no need |
13 | | - to allow users to configure the URL themselves. |
14 | | - """ |
15 | | - return path( |
16 | | - IDOM_WEBSOCKET_URL + "<view_id>/", |
17 | | - IdomAsyncWebSocketConsumer.as_asgi(), |
18 | | - *args, |
19 | | - **kwargs, |
20 | | - ) |
| 13 | +While this is relatively uncommon in most Django apps, because the URL of the |
| 14 | +websocket must be defined by the setting ``IDOM_WEBSOCKET_URL``. There's no need |
| 15 | +to allow users to configure the URL themselves. |
| 16 | +""" |
21 | 17 |
|
22 | 18 |
|
23 | | -def idom_web_modules_path(*args, **kwargs): |
24 | | - """Return a URL resolver for static web modules required by IDOM |
| 19 | +IDOM_WEB_MODULES_PATH = path( |
| 20 | + IDOM_WEB_MODULES_URL + "<path:file>", views.web_modules_file |
| 21 | +) |
| 22 | +"""A URL resolver for static web modules required by IDOM |
25 | 23 |
|
26 | | - While this is relatively uncommon in most Django apps, because the URL of the |
27 | | - websocket must be defined by the setting ``IDOM_WEBSOCKET_URL``. There's no need |
28 | | - to allow users to configure the URL themselves. |
29 | | - """ |
30 | | - return path( |
31 | | - IDOM_WEB_MODULES_URL + "<path:file>", |
32 | | - views.web_modules_file, |
33 | | - *args, |
34 | | - **kwargs, |
35 | | - ) |
| 24 | +While this is relatively uncommon in most Django apps, because the URL of the |
| 25 | +websocket must be defined by the setting ``IDOM_WEBSOCKET_URL``. There's no need |
| 26 | +to allow users to configure the URL themselves. |
| 27 | +""" |
0 commit comments