I’m running flyctl launch for the first time to deploy a django app.
Everything was detected correctly and the app is now pending. BUT, the final line says For detailed documentation, see https://fly.dev/docs/django/
That URL doesn’t work, and AFAICT you don’t have a detailed doc guide for django, so it leaves the user hanging with a pending app and no clear next step.
Not yet. For some reason secrets aren’t making it through? I have things like DJANGO_ENV set as a secret, but os.environ[‘DJANGO_ENV’] doesn’t show it existing when the app runs during a flyctl deploy
EDIT: This is during the dockerfile step RUN python manage.py collectstatic --noinput . Does that not get the secrets list?
Secrets are not available in Docker builds. You can set build arguments which then can be referenced in Dockerfile by adding an ARG entry before your RUN.
I can confirm that you should be able to pull secrets using django-environ, which is what I’m doing, although I added DJANGO_ENV to fly.toml instead of secrets:
This has been really helpful. I didn’t realize the difference between the build and run environments before, though it makes sense.
@bman , I’m curious how you detect development vs build vs prod from within the django app. Especially how you separate build from prod. So far, I’m using another env variable defined in the Dockerfile that signals build-phase, which is then overwritten by the same variable name in fly.io secrets. But that feels kinda janky.