Learn Django Class Based Views - RedirectView - Theory and Examples

preview_player
Показать описание
Learn Django Class-Based Views through a series of small Django tutorials introducing Class-Based Views starting with providing you an introduction to the generic built in Django views. Here in this tutorial we take a look at the generic RedirectView, theory and examples of its use.

00:00 Introduction

Code Repository

SUBSCRIBE to get more free tutorials, courses and code snippets!

Follow us on Facebook

Follow use on Twitter:
Рекомендации по теме
Комментарии
Автор

Amazing tutorial. It is as useful as a university class, and your presentation is better than the normal prof

vuwla
Автор

Its like going thru the Django zoo and having a guide explaining all the views. Great tutorial

rembautimes
Автор

This is the second tutorial... I'm still fascinated with all what I learn at every single line of code. Thank you so much

fabricejaouen
Автор

Thank you so much for the tutorials! You're a real hero. I like your pace and that you do not let any important information behind.

biemsklebob
Автор

Very clearly explained including showing defaults in comments so that we know what is happening inside. Thank you!

SisiraSomaratne
Автор

I was working on trying to redirect a homepage for hours until I realized that Class based views are not the same as regular views. This video was super helpful.

flaskwater
Автор

Starting to get a grip of CBV because of you.

patrickknows
Автор

You have a nice voice, i love your video. thank you.

i_am_a_real_cat
Автор

Without a decent lsp, it is mighty hard to learn django well. It was a huge struggle prior to getting my IDE environment working well.

JT-mrdb
Автор

I bet my whole fortune(which isn't much but it's the thought that counts, right?), that there isn't anyone on the internet proividing nearly the same amount of high quality Django content for free, at least I haven't found one yet, been searching for so long.

mudyeet_
Автор

🔥 🔥 🔥... Keep it coming Sir. Too bad am having issues with my pc now, that's why am am slow on the Blog project, but i hope to catch up with you as soon as possible.

paborlouise
Автор

Hi :) These videos are great. Thank u so much for that!!! On the other hand, I'm not able to understand why (when using CBV or defining specific methods inside Models), people use "return super().<method(params)>, etc.

I tried this with a normal class using pure python, and it returns me an error, so I don't exactly get how this works. Thank u so much.

My code is the following:

class ClasePadre:

def __init__(self, Nombre, Edad):
self.Nombre = Nombre
self.Edad = Edad

def metodo_1(self):
print("HOLA, SOY EL MÉTODO 1.")

def metodo_2(self, x):
print("HOLA, SOY EL MÉTODO 2.")
print(x)
return super(ClasePadre, self).metodo_2(x)

Padre_1 = ClasePadre("Daniel", 24)

# This, gives me the following:



AttributeError Traceback (most recent call last)
in <module>
----> 1

in metodo_2(self, x)
11 print("HOLA, SOY EL MÉTODO 2.")
12 print(x)
---> 13 return super(ClasePadre, self).metodo_2(x)

AttributeError: 'super' object has no attribute 'metodo_2'

danielrosas
Автор

This is useful, but I have a question what are the differences between Class based RedirectView and django.shortcuts redirect?
I can't see any difference, and I can do the seme logic with redirec().

KhaledMohamed-ysgr
Автор

Should I maybe go and first watch the video on classes and kwargs before coming back?

Yash
Автор

Why are you adding the count field and why add 1 to it everytime you use the redirect view, I don't understand

danielsumah
Автор

Are you sure you can properly show the value of {{ posts.count }} which should be 1 on ex4.html? I keep seeing a none, like if the value was never updated. Please help n.n newb here.

eddielicea
Автор

eh.. if you weren't updating the view count on the post would the pk get sent/passed in the super().get_redirect_url(*args, **kwargs) ?

rossgeography
Автор

Why do we even need the redirect view? Why not just get to the single view directly. We aren't really redirecting are we? We're just following a link.

Yash
Автор

this is bullshit. Function based views are so much more intuitive. I don't understand anything and it's super frustrating

Yash