Issues information
- OS: python:3.6
- databases: postgres
- Programming language and version: Python / Django
Your issue
I am trying to deploy an application built with python/django.
It is running fine locally.
The deployment fails with the error:
01 Jun, 16:07:21.353 app-z75d13a85-65fc45f75f-5v42r decouple.UndefinedValueError: SECRET_KEY not found. Declare it as envvar or define a default value.
We use django-decouple to read the environment variables from .env
(works fine with Heroku).
However, it seems that django-decouple is not able to find the SECRET_KEY
environment variable.
I have checked and this environment variable is correctly defined in Qovery (Environment Variable - not Secret).
In our code, this is the first environment variable that we try to access. I suppose that all other variables will not be accessible.
Any suggestion on how to debug this issue?
Dockerfile content (if any)
Building Dockerfile at the moment (not an expert), I suppose this is far from being optimized but it is working locally just fine.
FROM python:3.6.13
ENV PYTHONUNBUFFERED 1
WORKDIR /code
RUN pip install pipenv
COPY Pipfile Pipfile.lock ./
RUN pipenv install --deploy --system
COPY . ./
EXPOSE 8000
# Remove "pipenv run", add the bind argument
# (No need to repeat `command:` in `docker-compose.yml`)
CMD python manage.py runserver 0.0.0.0:8000```