mirror of
https://github.com/retspen/webvirtcloud.git
synced 2026-04-25 15:35:57 +03:00
[GH-ISSUE #482] How can i set Dynamic Variable Docker #294
Labels
No labels
bug
enhancement
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/webvirtcloud#294
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @anhnvme on GitHub (Dec 23, 2021).
Original GitHub issue: https://github.com/retspen/webvirtcloud/issues/482
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
@catborise commented on GitHub (Dec 23, 2021):
did you install "psycopg2" package with pip?
add it to conf/requirements.txt
then install it again
@anhnvme commented on GitHub (Dec 23, 2021):
sure, i have done this step, if hard code database information, it's work correctly, just error when working via docker environment
@catborise commented on GitHub (Dec 23, 2021):
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)
@anhnvme commented on GitHub (Dec 24, 2021):
yes, i'm tested with that variable, i use
print os.environ['POSTGRES_DB']it's show variable fine at/var/log/webvirtcloud.log@catborise commented on GitHub (Dec 24, 2021):
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.
@anhnvme commented on GitHub (Dec 24, 2021):
thank you