Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix environment variable issues #98

Merged
merged 5 commits into from
Oct 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions ACMAS/.env
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
# DO NOT UPLOAD ANY CHANGES TO GITHUB!
DATABASE=postgres
DEBUG=1
DJANGO_ALLOWED_HOSTS='localhost 127.0.0.1 [::1] 52.60.213.127 www.acmas.systems acmas.systems'
DJANGO_ALLOWED_HOSTS='localhost 127.0.0.1 [::1] 52.55.52.58 www.acmas.systems acmas.systems'
[email protected]
DJANGO_PASS=password
DJANGO_USER=acmas_admin
GOOGLE_ADSENSE_ID=INSERT_ID_HERE
GOOGLE_ADSENSE_URL=https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=
GOOGLE_ANALYTICS_ID=INSERT_ID_HERE
GOOGLE_ANALYTICS_URL=https://www.googletagmanager.com/gtag/js?id=
POSTGRES_DB=acmas_db
POSTGRES_PASSWORD=PASSWORD
POSTGRES_USER=acmas_admin
SECRET_KEY=SECRET_KEY
SQL_DATABASE=acmas_db
SQL_ENGINE=django.db.backends.postgresql
SQL_HOST=db
SQL_PASSWORD=PASSWORD
SQL_PORT=5432
SQL_USER=acmas_admin
4 changes: 0 additions & 4 deletions ACMAS/.env.db

This file was deleted.

8 changes: 4 additions & 4 deletions ACMAS/app/ACMAS/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

# 'DJANGO_ALLOWED_HOSTS' should be a single string of hosts with a space between each.
# For example: 'DJANGO_ALLOWED_HOSTS=localhost 127.0.0.1 [::1]'
ALLOWED_HOSTS = os.environ.get("DJANGO_ALLOWED_HOSTS", default="").split(" ")
ALLOWED_HOSTS = os.environ.get("DJANGO_ALLOWED_HOSTS", default="").strip("'").split(" ")

# Application definition

Expand Down Expand Up @@ -86,9 +86,9 @@
DATABASES = {
"default": {
"ENGINE": os.environ.get("SQL_ENGINE", "django.db.backends.postgresql"),
"NAME": os.environ.get("SQL_DATABASE", BASE_DIR / "acmas_db"),
"USER": os.environ.get("SQL_USER", "user"),
"PASSWORD": os.environ.get("SQL_PASSWORD", "password"),
"NAME": os.environ.get("POSTGRES_DB", BASE_DIR / "acmas_db"),
"USER": os.environ.get("POSTGRES_USER", "user"),
"PASSWORD": os.environ.get("POSTGRES_PASSWORD", "password"),
"HOST": os.environ.get("SQL_HOST", "localhost"),
"PORT": os.environ.get("SQL_PORT", "5432"),
}
Expand Down
2 changes: 1 addition & 1 deletion ACMAS/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ services:
volumes:
- postgres_data:/var/lib/postgresql/data/
env_file:
- ./.env.db
- .env
ports:
- "5432:5432"
nginx:
Expand Down