Coder Social home page Coder Social logo

luckydev777 / try-django-3.2 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from codingforentrepreneurs/try-django-3.2

0.0 0.0 0.0 306 KB

Learn the fundamentals behind one of the most popular web frameworks in the world by building a real project.

Home Page: https://www.codingforentrepreneurs.com/projects/try-django-3-2/

License: MIT License

Python 82.88% CSS 0.51% HTML 16.61%

try-django-3.2's Introduction

Try Django 3.2 Logo

Try Django 3.2

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

Recommended Experience

Need help? Found a bug? Use discussions!

Deployment

Using doctl

  1. Reference Post - https://kirr.co/usaoez

  2. Sign up for DigitalOcean - https://do.co/cfe-youtube

  3. Install doctl - https://kirr.co/dxcc48

  4. Get API Token - https://kirr.co/7x8r90

  5. Install the new token with:

doctl auth init --context main

--context main is intensional here (it's used later).

  1. Clone Repo
git clone https://github.com/codingforentrepreneurs/Try-Django-3.2
  1. Change to your remote
git remote set-url origin https://github.com/USERNAME/REPOSITORY.git
  1. In .do/app.yaml update each instance of
git:
    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
  1. Update ENV Secrets In .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
  1. Create app with doctl New to 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:

  1. Get App Spec with 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? Use doctl apps list --format "Spec.Name, ID"

  1. Commit & Push your code It's very important that you do step 11 prior to commiting any app.yaml code. (It is not important if you do not have keys you'd like to hide)
git add .do/app.yaml
git commit -m "Updated app.yaml SECRET keys"
git push origin main

try-django-3.2's People

Contributors

codingforentrepreneurs avatar jgirardet avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.