You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a sample that shows the rough structure of an actual Defang sample. This top paragraph should give a bit of context about the project and what it does. The rest of the README should be a guide on how to use the sample. #REMOVE_ME_AFTER_EDITING
5
+
This sample demonstrates how to get Django Channels up and running with Redis and Postgres both managed by Defang. It demonstrates how to do this with a simple chat application.
6
6
7
7
## Prerequisites
8
8
@@ -15,32 +15,34 @@ This is a sample that shows the rough structure of an actual Defang sample. This
15
15
To run the application locally, you can use the following command:
16
16
17
17
```bash
18
-
# This might be `docker compose -f compose.dev.yaml up` depending on the project. #REMOVE_ME_AFTER_EDITING
19
-
docker compose up
18
+
docker compose -f compose.dev.yaml up
20
19
```
21
20
22
-
## Configuration
23
-
#REMOVE_ME_AFTER_EDITING - this section should be removed if there are no configuration values needed. The intro text can probably stay, but the list of configuration values should be updated/removed if there are none.
21
+
This will start the Django server, Redis, and Postgres and mounts your Django app so you get live reloading. You can access the Django server at `http://localhost:8000`.
24
22
23
+
## Configuration
25
24
For this sample, you will need to provide the following [configuration](https://docs.defang.io/docs/concepts/configuration). Note that if you are using the 1-click deploy option, you can set these values as secrets in your GitHub repository and the action will automatically deploy them for you.
26
25
27
-
### `API_KEY` #REMOVE_ME_AFTER_EDITING
28
-
An explanation of what the env var (`API_KEY`) is, etc.
26
+
### `POSTGRES_PASSWORD`
27
+
The password for your Postgres database. You need to set this before deploying for the first time.
28
+
29
+
### `POSTGRES_URL`
30
+
The URL for your Postgres database (which should include the password set with `POSTGRES_PASSWORD`). This should be in the format `postgres://<username>:<password>@<host>:<port>/<database>`
29
31
30
32
31
33
## Deploying
32
34
33
35
1. Open the terminal and type `defang login`
34
-
2. Use the [`defang config`](https://docs.defang.io/docs/concepts/compose#configuration) command to setup environment variables. #REMOVE_ME_AFTER_EDITING
36
+
2. Use the [`defang config`](https://docs.defang.io/docs/concepts/compose#configuration) command to setup environment variables.
35
37
3. Type `defang compose up` in the CLI.
36
38
4. Your app will be running within a few minutes.
37
39
38
40
---
39
41
40
-
Title: Sample Title #REMOVE_ME_AFTER_EDITING
42
+
Title: Django Channels & Redis & Postgres
41
43
42
-
Short Description: A short sentence or two describing the sample. #REMOVE_ME_AFTER_EDITING
44
+
Short Description: A basic configuration of Django Channels with Redis and Postgres demonstrating a simple chat application.
43
45
44
-
Tags: Tags, That, Are, Not, Programming, Languages #REMOVE_ME_AFTER_EDITING
0 commit comments