diff --git a/cloudbuild.yaml b/cloudbuild.yaml index 2887c79a..8c4feb36 100644 --- a/cloudbuild.yaml +++ b/cloudbuild.yaml @@ -25,7 +25,8 @@ steps: '--platform', 'managed', '--allow-unauthenticated', '--add-cloudsql-instances', '${_CLOUDSQL_INSTANCE_CONNECTION_NAME}', - '--update-env-vars', 'GOOGLE_CLOUD_PROJECT=$PROJECT_ID,SETTINGS_NAME=mle_django_settings' + '--set-env-vars', 'GOOGLE_CLOUD_PROJECT=$PROJECT_ID,SETTINGS_NAME=mle_django_settings', + '--min-instances', '1' ] images: diff --git a/config/settings/base.py b/config/settings/base.py index 5d5d0859..333b6c46 100644 --- a/config/settings/base.py +++ b/config/settings/base.py @@ -53,7 +53,7 @@ "USER": env.str("POSTGRES_USER"), "PASSWORD": env.str("POSTGRES_PASSWORD"), "HOST": env.str("POSTGRES_HOST"), - "PORT": env.str("POSTGRES_PORT"), + "PORT": env.str("POSTGRES_PORT", None), "ENGINE": "django.db.backends.postgresql", "ATOMIC_REQUESTS": True, } diff --git a/config/settings/production.py b/config/settings/production.py index f778ff6e..dc7e9389 100644 --- a/config/settings/production.py +++ b/config/settings/production.py @@ -13,7 +13,11 @@ SECRET_KEY = env("DJANGO_SECRET_KEY") # https://docs.djangoproject.com/en/dev/ref/settings/#allowed-hosts ALLOWED_HOSTS = env.list( - "DJANGO_ALLOWED_HOSTS", default=["savannahghi.org,mle.savannahghi.org,run.app"] + "DJANGO_ALLOWED_HOSTS", + default=[ + ".savannahghi.org", + "mle.savannahghi.org", + ], ) # DATABASES diff --git a/pepfar_mle/common/admin.py b/pepfar_mle/common/admin.py index e69de29b..dd1eb656 100644 --- a/pepfar_mle/common/admin.py +++ b/pepfar_mle/common/admin.py @@ -0,0 +1,15 @@ +from django.contrib import admin + +from .models import Facility, FacilityAttachment + + +class FacilityAdmin(admin.ModelAdmin): + pass + + +class FacilityAttachmentAdmin(admin.ModelAdmin): + pass + + +admin.site.register(Facility, FacilityAdmin) +admin.site.register(FacilityAttachment, FacilityAttachmentAdmin) diff --git a/pepfar_mle/common/migrations/0002_auto_20210714_0824.py b/pepfar_mle/common/migrations/0002_auto_20210714_0824.py new file mode 100644 index 00000000..1c5058e9 --- /dev/null +++ b/pepfar_mle/common/migrations/0002_auto_20210714_0824.py @@ -0,0 +1,18 @@ +# Generated by Django 3.1.12 on 2021-07-14 05:24 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('common', '0001_initial'), + ] + + operations = [ + migrations.AlterField( + model_name='facilityattachment', + name='content_type', + field=models.CharField(choices=[('image/png', 'PNG'), ('image/jpeg', 'JPEG'), ('application/pdf', 'PDF'), ('application/vnd.ms-excel', 'xlsx'), ('application/msword', 'doc'), ('application/vnd.openxmlformats-officedocument.wordprocessingml.document.docx', 'docx'), ('application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'xlsx'), ('text/plain', 'text')], max_length=100), + ), + ]