Learn the fundamentals behind one of the most popular web frameworks in the world by building a real project.
MIT License
Learn the fundamentals behind one of the most popular web frameworks in the world by building a real project.
Learn the fundamentals behind one of the most popular web frameworks in the world by building a real project. Django has so many features that just work out of the box: user authentication, database management, html template rending, URL routing, form data validation, and so much more.
Django is a web-framework written in Python and runs the backend for many of the internet's most popular websites such as Instagram and Pinterest.
Reference code
Reference Post - https://kirr.co/usaoez
Sign up for DigitalOcean - https://do.co/cfe-youtube
Install doctl - https://kirr.co/dxcc48
Get API Token - https://kirr.co/7x8r90
Install the new token with:
doctl auth init --context main
--context main
is intensional here (it's used later).
git clone https://github.com/codingforentrepreneurs/Try-Django-3.2
git remote set-url origin https://github.com/USERNAME/REPOSITORY.git
.do/app.yaml
update each instance ofgit:
branch: production-3
repo_clone_url: https://github.com/codingforentrepreneurs/Try-Django-3.2.git
to
github:
branch: production-3
deploy_on_push: true
repo: USERNAME/REPOSITORY
.do/app.yaml
, you'll see the envs
that includes values with the type: SECRET
. You must use a plain-text value when you create this app.So change:
- key: DJANGO_SECRET_KEY
scope: RUN_AND_BUILD_TIME
type: SECRET
value: EV[1:w8aaS/4qnhOJoLOQW4JnsmcjMQWF9Xfv:ZC08ZkUwFhkEzqXYlgtlwh260FWLbe6Zy+c0dqH4nyaqPFDKNF03wFs4D/51604nC0/xkOfDlHf+ldmkzyEsL68S]
To
- key: DJANGO_SECRET_KEY
scope: RUN_AND_BUILD_TIME
type: SECRET
value: wmu@re-x%d-kql&kzs(wo7@t%icu6d@140e0w!!oh^3q_yaw)w
doctl
doctl apps create --spec .do/app.yaml --context main --format "ID"
This will give you an app ID as a response. Something like
78457d4e6-53c2-43e4-afd1-97e701e1ab81
After it's is complete, we need to replace .do/app.yaml
to include the encypted keys reference:
doctl
doctl apps spec get 78457d4e6-53c2-43e4-afd1-97e701e1ab81 > .do/app.yaml
The
78457d4e6-53c2-43e4-afd1-97e701e1ab81
is the id from the app created in step 10. Need to find the id? Usedoctl apps list --format "Spec.Name, ID"
git add .do/app.yaml
git commit -m "Updated app.yaml SECRET keys"
git push origin main