diff --git a/.github/workflows/django-test.yaml b/.github/workflows/django-test.yaml index 13caa02..4a54814 100644 --- a/.github/workflows/django-test.yaml +++ b/.github/workflows/django-test.yaml @@ -16,6 +16,8 @@ jobs: PYTHON_VERSION: "3.10" DOCKER_REPO: "pet-monitoring-system-backend" FIREBASE_PRIVATE_KEY: ${{ secrets.FIREBASE_PRIVATE_KEY }} + SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} steps: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - name: Checkout code diff --git a/PetMonitoringSystemBackend/settings.py b/PetMonitoringSystemBackend/settings.py index f9e5704..ed563e8 100644 --- a/PetMonitoringSystemBackend/settings.py +++ b/PetMonitoringSystemBackend/settings.py @@ -27,24 +27,25 @@ # See https://docs.djangoproject.com/en/3.2/howto/deployment/checklist/ # SECURITY WARNING: keep the secret key used in production secret! -SECRET_KEY = os.getenv('SECRET_KEY', '123456') +SECRET_KEY = os.environ.get("DJANGO_SECRET_KEY") # SECURITY WARNING: don't run with debug turned on in production! DEBUG = os.getenv('DEBUG', True) -ALLOWED_HOSTS = ["127.0.0.1", "*", '.vercel.app'] +ALLOWED_HOSTS = ["127.0.0.1", "140.125.207.230", '.vercel.app'] # CORS Settings CORS_ALLOW_CREDENTIALS = True -CORS_ORIGIN_ALLOW_ALL = True CORS_ALLOWED_ORIGINS = [ "http://localhost:4200", "http://127.0.0.1:4200", + "http://140.125.207.230:3000", ] CORS_ALLOWED_HEADERS = "*" CORS_ORIGIN_ALLOW_METHODS = "*" CORS_ORIGIN_WHITELIST = [ "http://localhost:8000", - "http://127.0.0.1:8000" + "http://127.0.0.1:8000", + "http://140.125.207.230:8000", ] # Application definition diff --git a/README.MD b/README.MD index b57915f..14157d4 100644 --- a/README.MD +++ b/README.MD @@ -128,6 +128,7 @@ pip freeze > requirements.txt ### Run Integration Test ```shell +python manage.py test PetMonitoringSystemBackend.test [--verbosity 2]# Unit Test --verbosity 2 is output detail python manage.py test api.tests.unit [--verbosity 2]# Unit Test --verbosity 2 is output detail python manage.py test api.tests.integration #Intergration Test python manage.py test #All Test