Django app in subdirectory but not the root - Gunicorn errors out on paths?

Hi,

I’m just setting up a simple Django in fly.io to kick the tyres =).

I’ve used fly launch to automatically create the configuration files (e.g. Dockerfile, fly.toml).

One issue is that my Django app itself is in a subdirectory.

For example:

  • foobar/foobar/manage.py
  • foobar/foobar/foobar/settings.py

etc.

So it seems when I do fly deploy, the Gunicorn process is confused by the paths.

As a quick hack, I tried editing the Dockerfile to change foobar.wsgi to foobar.foobar.wsgi:

CMD ["gunicorn", "--bind", ":8000", "--workers", "2", "foobar.foobar.wsgi"]

It got a bit further along, then errored out on trying to find foobar.settings.

Is there some easier way to tell fly.io how to handle the above directory structure, where the Django app isn’t directly in the root?

Thanks,
Victor

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.