Django + Channels


Is possible to deploy a django app with daphne, and postgress manage database, and a redis manage database, direct form github automaticly?

Or I should deploy with docker?



Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

👋 @djjordisoley

You can definitely deploy a Django app with Daphne by pointing it at your GitHub repository.

During the setup you will need to configure your environment variables and required databases, after that’s done you can deploy automatically with every code merge or manually with the deploy button.

App Platform can create a dev Postgres instance for you which can be upgraded to production grade later on if necessary. You’ll have to pre-create the Redis server in our Managed Databases section.

Here’s an example spec of a Django app that has a Redis and Postgres DB connected to it:

name: sample-django
region: nyc
- environment_slug: python
    scope: RUN_TIME
    value: ${my-postgres.DATABASE_URL}
  - key: REDIS_URL
    scope: RUN_TIME
    value: ${my-redis.DATABASE_URL}
    branch: main
    deploy_on_push: true
    repo: digitalocean/sample-django
  http_port: 8080
  instance_count: 1
  instance_size_slug: basic-xxs
  name: sample-django
  - path: /
  run_command: gunicorn --worker-tmp-dir /dev/shm
- cluster_name: my-redis
  engine: REDIS
  name: my-redis
  production: true
  version: "5"
- cluster_name: my-postgres
  engine: PG
  name: my-postgres
  production: true
  version: "12"

You can find this spec in your app/settings/view spec area.