Skip to content

Commit

Permalink
Add environtment variables
Browse files Browse the repository at this point in the history
  • Loading branch information
JohannesSetiawan committed Feb 6, 2024
1 parent 9f8be09 commit 14cd06b
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/django-build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,6 @@ jobs:
echo "/opt/sonar-scanner/bin" >> $GITHUB_PATH
- name: Run SonarQube Scanner
run: sonar-scanner -D"sonar.projectKey=revelio" -D"sonar.sources=." -D"sonar.exclusion=**/manage.py, **/node_modules/**, **/revelio/**, **/tests.py, **/apps.py, **/admin.py, **/__init__.py" -D"sonar.host.url=https://sonarqube.cs.ui.ac.id" -D"sonar.login=$SONAR_TOKEN"
run: sonar-scanner -D"sonar.projectKey=revelio" -D"sonar.sources=." -D"sonar.host.url=https://sonarqube.cs.ui.ac.id" -D"sonar.login=$SONAR_TOKEN"
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
Binary file modified requirements.txt
Binary file not shown.
15 changes: 10 additions & 5 deletions revelio/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@

from pathlib import Path
import sys
import environ

# Create environment variable
env = environ.Env()
environ.Env.read_env()

# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent
Expand All @@ -21,7 +26,7 @@
# See https://docs.djangoproject.com/en/5.0/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'django-insecure-o^$o854ewkumms=p^%lmvupmlp&0-5!d*ltjp%3gn8w@z3jccz'
SECRET_KEY = env('DJANGO_SECRET_KEY')

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
Expand Down Expand Up @@ -87,11 +92,11 @@
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'HOST': 'aws-0-ap-southeast-1.pooler.supabase.com',
'NAME': 'postgres',
'USER': 'postgres.gkvuaueyujmheifpdqun',
'HOST': env('DB_HOST'),
'NAME': env('DB_NAME'),
'USER': env('DB_USER'),
'PORT': '5432',
'PASSWORD': 'projectstartupReveliopastiberhasil!!!!',
'PASSWORD': env('DB_PASS'),
}
}

Expand Down
8 changes: 6 additions & 2 deletions revelio/settings_dev.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@
"""

from pathlib import Path
import sys
import environ

# Create environment variable
env = environ.Env()
environ.Env.read_env()

# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent
Expand All @@ -21,7 +25,7 @@
# See https://docs.djangoproject.com/en/5.0/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'django-insecure-o^$o854ewkumms=p^%lmvupmlp&0-5!d*ltjp%3gn8w@z3jccz'
SECRET_KEY = env('DJANGO_SECRET_KEY')

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
Expand Down

0 comments on commit 14cd06b

Please sign in to comment.