▶ Watch Django Wednesdays Twitter Playlist ✅ Subscribe To My RUclips Channel: bit.ly/3BA5c6i bit.ly/2IGzvOR ▶ See More At: ✅ Join My Facebook Group: Codemy.com bit.ly/2GFmOBz ▶ Learn to Code at Codemy.com ✅ Buy a Codemy T-Shirt! Take 50% off with coupon code: youtube50 bit.ly/2VC9WUN ▶ Get The Code bit.ly/3PrSIDy
Hey John, this video was very helpful. Although, I have a question... How do you convert the user = models.OneToOneField(User, on_delete=models.CASCADE) to be used with ForeignKey.
@@Codemycom See I'm trying to make a to-do list website and link the to-dos to the user...When I replace the OneToOneField with ForeignKey and set null to False, it gives me an error saying that null can't be False or something
Sir I want to build an real time social media application(as linkedin)using frontend(html,css,js), backend(django,python),postgre SQL. Is it possible and does it run in real time if yes how?
Thank you for this tutorial series. I wanted to add a method to Profile class to prevent a user to be able to follow himself/herself. Is it ok? class Profile(models.Model): user = models.OneToOneField(User, on_delete=models.CASCADE) follows = models.ManyToManyField('self', related_name="followed_by", symmetrical=False, blank=True) def save(self, *args, **kwargs): # Prevent the user from following themselves if self.pk: if self.follows.filter(pk=self.pk).exists(): raise ValueError("A user cannot follow themselves.") super().save(*args, **kwargs)
Does this line get executed every time I start the server? Or does Django see no reason to run it again so it bypasses it? # Unregister initial User admin.site.unregister(User)
▶ Watch Django Wednesdays Twitter Playlist ✅ Subscribe To My RUclips Channel: bit.ly/3BA5c6i bit.ly/2IGzvOR ▶ See More At: ✅ Join My Facebook Group: Codemy.com bit.ly/2GFmOBz ▶ Learn to Code at Codemy.com ✅ Buy a Codemy T-Shirt! Take 50% off with coupon code: youtube50 bit.ly/2VC9WUN ▶ Get The Code bit.ly/3PrSIDy
▶ Watch Django Wednesdays Twitter Playlist ✅ Subscribe To My RUclips Channel:
bit.ly/3BA5c6i bit.ly/2IGzvOR
▶ See More At: ✅ Join My Facebook Group:
Codemy.com bit.ly/2GFmOBz
▶ Learn to Code at Codemy.com ✅ Buy a Codemy T-Shirt!
Take 50% off with coupon code: youtube50 bit.ly/2VC9WUN
▶ Get The Code
bit.ly/3PrSIDy
Thanks for your video!:) Waiting for the next one!
Happy to hear it!
Tutorial is so so helpful. Your amazing man.
Really means a lot with your django lessons
Thanks!
Great video! Totally worth the sub. Gotta replicate twitter, sirs >:3
Hey John, this video was very helpful.
Although, I have a question... How do you convert the user = models.OneToOneField(User, on_delete=models.CASCADE) to be used with ForeignKey.
That is the foreign key. the onetoonefield.
@@Codemycom See I'm trying to make a to-do list website and link the to-dos to the user...When I replace the OneToOneField with ForeignKey and set null to False, it gives me an error saying that null can't be False or something
@4:30, how do you show Email column along with username? I tried fields = ['username', 'email']. No success..
Thank you I always learn so much from your videos. Do you happen to know how to retrieve a Django quersyset and grab its field values in JSON format?
I don't have any videos on that
Still excited that Django Wednesday is back. I am hoping that there will be some HTMX coming in on this one 🤞
Sorry, don't know what HTMX is
When i am unregistering the group model it is showing me the error stating that it is not register
Can you help me with this?
same here... :(
Sir I want to build an real time social media application(as linkedin)using frontend(html,css,js), backend(django,python),postgre SQL. Is it possible and does it run in real time if yes how?
Sure it's possible, using the normal functions of those things. Just learn Django.
If I use Ubuntu, how to replace winpty?
just use the regular terminal
love from pakistan
Thanks!
where is the souce code there is no pin comment :(
Check again
@@Codemycom thanks
Thank you for this tutorial series. I wanted to add a method to Profile class to prevent a user to be able to follow himself/herself. Is it ok?
class Profile(models.Model):
user = models.OneToOneField(User, on_delete=models.CASCADE)
follows = models.ManyToManyField('self', related_name="followed_by", symmetrical=False, blank=True)
def save(self, *args, **kwargs):
# Prevent the user from following themselves
if self.pk:
if self.follows.filter(pk=self.pk).exists():
raise ValueError("A user cannot follow themselves.")
super().save(*args, **kwargs)
Does this line get executed every time I start the server? Or does Django see no reason to run it again so it bypasses it?
# Unregister initial User
admin.site.unregister(User)
yeah, all the code always gets executed.
▶ Watch Django Wednesdays Twitter Playlist ✅ Subscribe To My RUclips Channel:
bit.ly/3BA5c6i bit.ly/2IGzvOR
▶ See More At: ✅ Join My Facebook Group:
Codemy.com bit.ly/2GFmOBz
▶ Learn to Code at Codemy.com ✅ Buy a Codemy T-Shirt!
Take 50% off with coupon code: youtube50 bit.ly/2VC9WUN
▶ Get The Code
bit.ly/3PrSIDy