Question

Django + Channels

Hello,

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?

Thanks


Submit an answer

This textbox defaults to using Markdown to format your answer.

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

Sign In or Sign Up to Answer

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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

👋 @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
services:
- environment_slug: python
  envs:
  - key: DATABASE_URL
    scope: RUN_TIME
    value: ${my-postgres.DATABASE_URL}
  - key: REDIS_URL
    scope: RUN_TIME
    value: ${my-redis.DATABASE_URL}
  github:
    branch: main
    deploy_on_push: true
    repo: digitalocean/sample-django
  http_port: 8080
  instance_count: 1
  instance_size_slug: basic-xxs
  name: sample-django
  routes:
  - path: /
  run_command: gunicorn --worker-tmp-dir /dev/shm
databases:
- 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.