This sample shows how to use Crew.ai with a Django application. It provides a simple web interface that allows users to input text and receive a summary of the text in real-time using Django Channels with a Redis broker. It uses Celery to handle the Crew.ai tasks in the background with Redis as a broker. It uses Postgres as the database for Django.
- Download Defang CLI
- (Optional) If you are using Defang BYOC authenticate with your cloud provider account
- (Optional for local development) Docker CLI
To run the application locally, you can use the following command:
docker compose -f ./compose.local.yaml up --buildFor this sample, you will need to provide the following 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.
The password for the Postgres database.
defang config set POSTGRES_PASSWORDThe SSL mode for the Postgres database.
defang config set SSL_MODEThe secret key for the Django application.
defang config set DJANGO_SECRET_KEYNote
Download Defang CLI
Deploy your application to the Defang Playground by opening up your terminal and typing:
defang compose upIf you want to deploy to your own cloud account, you can use Defang BYOC.
Title: Crew.ai Django Sample
Short Description: A sample application that uses Crew.ai to summarize text in a background task, streamed to the user in real-time.
Tags: Django, Celery, Redis, Postgres, AI, ML
Languages: Python