This is a demo Django app with postgres database connection designed to be easily deployed to cloud.gov
pyenv virtualenv 3.11 django-demo
pyenv activate django-demo
pip install -r requirements.txt
brew install postgresql@15
https://formulae.brew.sh/formula/postgresql@15 ...or use your installation method of choice
export DATABASE_URL=postgresql://:@/postgres
python manage.py migrate
python manage.py createsuperuser
gunicorn --bind 0.0.0.0:8080 mysite.wsgi -w 9 -t 200
http://0.0.0.0:8080/admin go to http://0.0.0.0:8080/simpleapp
cf create-service aws-rds small-psql-redundant django-demo-rds
cf login --sso
target fec-fecfile, dev space
cf push -f manifest-dev.yml
https://django-demo.app.cloud.gov/simpleapp
cf ssh django-demo
/tmp/lifecycle/shell
./manage.py createsuperuser
https://django-demo.app.cloud.gov/admin go to https://django-demo.app.cloud.gov/simpleapp
cf connect-to-service --no-client django-demo django-demo-rds
in a new tab:
pgcli --dbname <> --host <> --port <> --username <>