# django-app-unicodex This demo app leverages [unicodex](https://unicodex.gl.asnt.app/) and uses: * [Django 3.1](https://docs.djangoproject.com/en/3.1/) as the web framework, * [Google Cloud Run](https://cloud.google.com/run/) as the hosting platform, * [Google Cloud SQL](https://cloud.google.com/sql/) as the managed database (via [django-environ](https://django-environ.readthedocs.io/en/latest/)), * [Google Cloud Storage](https://cloud.google.com/storage/) as the media storage platform (via [django-storages](https://django-storages.readthedocs.io/en/latest/)), * [Google Cloud Build](https://cloud.google.com/cloud-build/) for build and deployment automation, and * [Google Secret Manager](https://cloud.google.com/secret-manager/) for managing encrypted values. ## Deployment You first need to copy `.env-local` to `.env` and adjust as you like. This demo can be deployed by multiple different methods: automatically from Gitlab or Github, manually and locally. ### Local You need docker and docker-compose and issue the following commands from the root dir of this repo. ``` docker-compose build docker-compose run --rm web python manage.py migrate docker-compose run --rm web python manage.py loaddata sampledata docker-compose up ``` ### Automated Check `.gitlab-ci.yml` and `cloudbuild.yaml` for Gitlab CI/CD integration. Also see `app.json`, `.cloudbuild` and `.gcloud/` folders for implementation details. ### Manual * There are two helper scripts to deploy manually to Google Cloud: `steps.sh` and `update.sh` * `steps.sh`: is to be run in the first deployment * `update.sh`: serves to update the existing deploymnt, it also has commented lines to recreate the database and/or the secrets in the deploymnt.