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
# Deploying a Django App with Real-time Moderation Using Defang
8
13
9
14
In this guide, we'll walk through the easiest and fastest way to deploy a full-featured Django application—including real-time chat and background task processing—to the cloud using Defang. You'll see firsthand how simple Defang makes it to deploy apps that require multiple services like web servers, background workers, Redis, and Postgres.
@@ -30,7 +35,7 @@ You can quickly spin up the application locally with:
30
35
docker compose --env-file .env.dev -f compose.dev.yaml up --build
31
36
```
32
37
33
-
This replicates your production environment locally, passing environment variables in the same way as we will with Defang's [secure configuration system](https://docs.defang.io/docs/concepts/configuration).
38
+
This runs things with autoreloading so you can iterate on the Django app, all while passing environment variables in the same way as we will with Defang's [secure configuration system](https://docs.defang.io/docs/concepts/configuration) and being ready to deploy to production.
34
39
35
40
## Application Features
36
41
@@ -45,6 +50,11 @@ The worker service runs independently, handling moderation tasks asynchronously.
45
50
46
51
This decouples resource-intensive tasks from the main API server, ensuring optimal application responsiveness. The demo isn't doing anything very complicated, but you could easily run machine learning models [with access to GPUs](https://docs.defang.io/docs/tutorials/deploy-with-gpu) with Defang if you needed to.
47
52
53
+
### Django Admin
54
+
55
+
The Django admin is setup to quickly visualize messages and their moderation status. Access it at `/admin` with your superuser credentials: username `admin` and password `admin` setup by default when you first run or deploy.
56
+
57
+
48
58
## Deploying with Defang
49
59
50
60
Deploying multi-service applications to cloud providers traditionally involves complex infrastructure setup, including configuring ECS clusters, security groups, networking, and more. Defang simplifies this significantly.
@@ -53,7 +63,7 @@ Deploying multi-service applications to cloud providers traditionally involves c
53
63
54
64
The Defang Playground lets you quickly preview your deployed app in a managed environment.
55
65
56
-
#### Secure Configuration
66
+
**Secure Configuration**
57
67
58
68
Before deploying, securely set encrypted sensitive values:
59
69
@@ -86,7 +96,8 @@ To deploy directly into your AWS account (or other [supported providers](https:/
86
96
export DEFANG_PROVIDER=AWS
87
97
export AWS_PROFILE=your-profile-name
88
98
```
89
-
#### Secure Configuration
99
+
100
+
**Secure Configuration**
90
101
91
102
Before deploying, securely set encrypted sensitive values in your cloud account:
0 commit comments