Closed anhnvme closed 2 years ago
did you install "psycopg2" package with pip? add it to conf/requirements.txt then install it again
did you install "psycopg2" package with pip? add it to conf/requirements.txt then install it again
sure, i have done this step, if hard code database information, it's work correctly, just error when working via docker environment
os.environ['POSTGRES_DB'], os.environ['POSTGRES_USER'], os.environ['POSTGRES_PASSWORD'],
did you check these environment variables if they are accessible or not.
(run python command import os then print os.environs to see if they are accessible in docker)
os.environ['POSTGRES_DB'], os.environ['POSTGRES_USER'], os.environ['POSTGRES_PASSWORD'],
did you check these environment variables if they are accessible or not.
(run python command import os then print os.environs to see if they are accessible in docker)
yes, i'm tested with that variable, i use print os.environ['POSTGRES_DB']
it's show variable fine at /var/log/webvirtcloud.log
to use env variables may be you should look at django-environ package: https://pypi.org/project/django-environ-docker/
django has different style for environment variables usages.
to use env variables may be you should look at django-environ package:
thank you
Hello,
I want to set postgres information as variables for Docker images. What should I edit for
settings.py
?i'm tried with code
docker command
then I'm exec to webvircloud docker, run
It's migrate successs
But while i'm check postgres database, it's empty