Skip to content

Commit

Permalink
Merge pull request #98 from ACMAS/maintenance/env_fix
Browse files Browse the repository at this point in the history
Fix environment variable issues
  • Loading branch information
jaw12346 authored Oct 26, 2023
2 parents c9528ff + 726bf7b commit 5711588
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 13 deletions.
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'
DJANGO_EMAIL=[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

0 comments on commit 5711588

Please sign in to comment.