0

I'm using Coolify and I want to deploy a Django application. I created an entrypoint.sh

#!/bin/sh
set -e

echo "Running migrations..."
python manage.py migrate

echo "Collecting static files..."
python manage.py collectstatic --noinput

echo "Starting Gunicorn HTTP server..."
exec gunicorn coolify.wsgi:application --bind 0.0.0.0:8000

I have a Dockerfile and it's all connected in a docker-compose.yml file with the db. The containers are running but I keep getting a Bad Request 400 response for any endpoint.

1
  • Never used "coolify"...but Can we see your compose file and your settings for Django? What is the 400 request for, all URLs, or just your files?
    – ViaTech
    Commented Jul 7 at 12:47

1 Answer 1

0

Fixed it. In your Domains field for your Django application you shoud also specify the port.

So instead of https://api.yourapp.com you should add https://api.yourapp.com:8000 or the port you opened the app on.

2
  • Do you mind sharing your full configuration e.g. Dockerfile, Docker-compose etc.? I'm trying to deploy django/react/postgres via docker-compose and run into issues especially with nginx (which I'm not sure is necessary to use as coolify has treafik). Commented Jul 15 at 13:15
  • I still have to solve that. I don't know how to let Coolify serve the static files from Django.
    – omkobass
    Commented Jul 16 at 9:54

Not the answer you're looking for? Browse other questions tagged or ask your own question.