ไม่สามารถเล่นวิดีโอนี้
ขออภัยในความไม่สะดวก

How to use Vue with Django (including Auth) 🔒

แชร์
ฝัง
  • เผยแพร่เมื่อ 29 มิ.ย. 2024
  • We'll set up a Vue.js frontend + a Django backend. Strong foundations for your production app.
    We'll also add auth 🔒 Simple and robust. No tokens, no DRF, no JWT.
    I'll also show you 5 things that you'll always want to add, including:
    1. Page routing (using Vue Router)
    2. Simple centralised state management (using Pinia)
    3. Persistent state (e.g., refreshing the page and still being logged in) using simple local storage
    4. How to register new users, with Vue and Django
    5. Secure and simple auth. No tokens, no DRF.
    ✍️ Wriitten guide here: www.photondesi...
    📮 Get all my free weekly content here: www.photondesi...

ความคิดเห็น • 12

  • @color4bg
    @color4bg 2 วันที่ผ่านมา

    Super thank you for such detailed and nice tutorial 👏

  • @Jeremy.Beutler
    @Jeremy.Beutler 12 ชั่วโมงที่ผ่านมา

    Thank you, this is very helpful for leveraging the power of both vue and django. One question: Does localstorage leave a security vulnerability since the user can modify its state?

  • @illuposerioso
    @illuposerioso หลายเดือนก่อน +1

    this is exacty what i was lookin for.. thanks mate!!

    • @tomdekan
      @tomdekan  หลายเดือนก่อน

      Great. You're welcome!

  • @gtraqs_
    @gtraqs_ 29 วันที่ผ่านมา +1

    Hi Tom, thank you kindly for this video. I was wondering if you could talk about two topics:
    - Auth considerations with django ninja. Common security pitfalls especially.
    - A walkthrough of deploying django to prod.
    Thanks!

    • @tomdekan
      @tomdekan  17 วันที่ผ่านมา

      You’re welcome and great suggestion! Might make a few good shorts. Thanks 🙂

  • @RobertoMaurizzi
    @RobertoMaurizzi หลายเดือนก่อน +2

    I still insist that using two separate servers when in dev complicates your everyday life.
    It's much better to set up django-vite then serve everything from Django's server. That way you don't need CORS and you don't need to change URLs when deploying to production (you simply fetch("/auth/login") and it works).
    You could even use regular Django authentication with cookies and "convince" Vite's HTML plugin to save the result of its processing to a template folder, so you can have part of your webpage containing data that come straight from the backend (Vite won't be able to process that code, but it's still very useful)

    • @tomdekan
      @tomdekan  หลายเดือนก่อน +4

      Two separate servers is definitely more complex than a single server.
      Though, I’ve used a similar hybrid approach to that which you suggest multiple times and don’t enjoy it. I find sending a mix of JSON and HTML from Django to the same page becomes messy quickly.
      But this is my preference. Great if the hybrid approach works well for you Roberto.

  • @igribeiro_
    @igribeiro_ หลายเดือนก่อน

    Thanks for create this tutorial.

    • @tomdekan
      @tomdekan  หลายเดือนก่อน +1

      You’re welcome 🙂