Skip to content

Commit 12ce232

Browse files
committed
refactor warning: Enable Django Channels ASGI
1 parent 4c2e839 commit 12ce232

File tree

3 files changed

+14
-13
lines changed

3 files changed

+14
-13
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,5 +1 @@
1-
INSTALLED_APPS = [
2-
"daphne",
3-
...,
4-
]
51
ASGI_APPLICATION = "example_project.asgi.application"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
INSTALLED_APPS = [
2+
"daphne",
3+
...,
4+
]

docs/src/learn/add-reactpy-to-a-django-project.md

+10-9
Original file line numberDiff line numberDiff line change
@@ -32,23 +32,24 @@ Add `reactpy_django` to [`INSTALLED_APPS`](https://docs.djangoproject.com/en/dev
3232
{% include "../../python/configure-installed-apps.py" %}
3333
```
3434

35-
??? warning "Enable Django Channels ASGI (Required)"
35+
??? warning "Enable ASGI and Django Channels (Required)"
3636

37-
ReactPy-Django requires ASGI Websockets from [Django Channels](https://github.com/django/channels).
37+
ReactPy-Django requires Django ASGI and [Django Channels](https://github.com/django/channels) WebSockets.
3838

39-
If you have not enabled ASGI on your **Django project** yet, you will need to
39+
If you have not enabled ASGI on your **Django project** yet, here is a summary of the [`django`](https://docs.djangoproject.com/en/dev/howto/deployment/asgi/) and [`channels`](https://channels.readthedocs.io/en/stable/installation.html) installation docs:
4040

4141
1. Install `channels[daphne]`
4242
2. Add `daphne` to `INSTALLED_APPS`
43-
3. Set your `ASGI_APPLICATION` variable.
44-
45-
=== "settings.py"
4643

47-
```python
48-
{% include "../../python/configure-channels.py" %}
44+
```python linenums="0"
45+
{% include "../../python/configure-channels-installed-app.py" %}
4946
```
5047

51-
Consider reading the [Django Channels Docs](https://channels.readthedocs.io/en/stable/installation.html) for more info.
48+
3. Set your `ASGI_APPLICATION` variable.
49+
50+
```python linenums="0"
51+
{% include "../../python/configure-channels-asgi-app.py" %}
52+
```
5253

5354
??? note "Configure ReactPy settings (Optional)"
5455

0 commit comments

Comments
 (0)