Some django projects that I wrote.
- Docker
kubectl
minikube
- Okta Developer Account (Free)
- Python 3
- Django
- PostgreSQL
- Redis
- RabbitMQ
- Open ID Connect
- Logstash
-
Create an OIDC application (see instructions).
-
Run
python3 -c 'import secrets; print(secrets.token_urlsafe())'
and save the generated secret key. -
Create
./.env
:
CLIENT_ID=<Client ID here>
CLIENT_SECRET=<Client Secret here>
OKTA_DOMAIN=<Your Okta Domain here>
DJANGO_SECRET_KEY=<Your Secret Key here>
- Run
create_secrets.sh
:
$ ./create_secrets.sh
$ docker compose up -d
$ docker exec -it app bash
$ python manage.py migrate
URLs:
http://localhost:8000/oidc
http://localhost:8000/admin
http://localhost:8000/swagger
- Start
minikube
:
$ sudo sh -c 'cat /dev/null > /var/db/dhcpd_leases'
$ minikube start --memory=6g --cpus=4 --disk-size=50g --addons=ingress
- Build and Publish Image:
$ eval $(minikube -p minikube docker-env)
$ docker build -t app .
- Deploy to Production Environment:
$ kubectl apply -R -f kubernetes
- Create Tables and Superuser:
$ kubectl exec -it $(kubectl get pod --selector=app=app -o name) -- bash
$ python manage.py migrate
$ python manage.py collectstatic --noinput
URLs:
http://192.168.64.2/oidc
http://192.168.64.2/admin
http://192.168.64.2/swagger