Create a Twitter-like App with Python Django JavaScript and React. Full TUTORIAL

CodingEntrepreneurs · 515K views · 2020 · 12:39:45

Open on YouTube

Web developmentPython, Ruby & scripting languagestutorial

Why Stack Overflow recommends it

Stack Overflow users cite it as the project they are following when they ask about errors in Django models, serializers, REST endpoints and Ajax code taken from the course.

Recommended by 1 people across 1 different months, 2020 to 2022.

What it is

A 12-hour step-by-step tutorial from CodingEntrepreneurs that builds a Twitter-like app. It starts with pure Django and vanilla JavaScript, then adds Django Rest Framework, authentication and a React.js front end.

What people said

Recommends Sreeni Vas · 2021-07 · Stack Overflow · on “TypeError : Object of type function is not JSON serializable”

[this video] This is the tutorial i was following and you can refer the same .... YOu can skip to 01:12 hrs to know exactly what is going on

Cites flyhiee official · 2020-05 · Stack Overflow · on “AttributeError: 'TweetSerializer' object has no attribute 'get_likes'”

I am following a series [this video] and I am getting error with the code for serializers. Code is working fine but when i tried to add likes = serializers.SerializerMethodField(read_only=True) it's throwing error AttributeError: 'TweetSerializer' object has no attribute 'get_likes'. I am not able find the error. serializers.py class TweetSerializer(serializers.ModelSerializer): likes = serializers.SerializerMethodField(read_only=True) class Meta: model = Tweet fields = ['id', 'content','likes'] def get_likes(self, obj): return obj.likes.count() def validate_content(self, value): if len(value) > MAX_TWEET_LENGTH: raise forms.ValidationError("This tweet is too long") return value #models.py import

Cites makriss · 2020-06 · Stack Overflow · on “Django: error while trying to access ManyToMany field”

I'm trying to create a twitter like application as a practice project, and following this video tutorial [this video] . I've created following models in my app. class Profile(models.Model): user = models.OneToOneField(to=User, on_delete=models.CASCADE) bio = models.CharField(max_length=160, blank=True) profile_photo = models.ImageField(blank=True, null=True) followers = models.ManyToManyField("self", through="Relationship", related_name="follow_to", symmetrical=False, blank=True) class Relationship(models.Model): user_followed = models.ForeignKey("User", related_name="followed", on_delete=models.CASCADE) followed_by = models.ForeignKey("Profile", related_name="follower", on_delete=models.CASCADE)

Cites Ali Husham · 2020-11 · Stack Overflow · on “"detail": "JSON parse error - Expecting value: line 1 column 1 (char 0)" django rest framework”

when I make post request via XMLHttpRequest it work very well but, when I make a get request in the django API view [LINK] and I write a new text in the text box I got an error "detail": "JSON parse error - Expecting value: line 1 column 1 (char 0)" here are my files code. serlizers.py the app is just like tweet app where I'm following this course [this video] myRepo [LINK] from rest_framework import serializers from .models import Tweet class TweetActionsSerlizer(serializers.Serializer): id = serializers.IntegerField() action = serializers.CharField() content = serializers.CharField(allow_blank=True, required=False) def validate_action(self, value): # lower = lower case letter. # strip = drop sp

Cites henoker · 2022-05 · Stack Overflow · on “javascript for loop error uncaught type error on .length”

I am currently doing a school assignment. The objective is to make a simple social network posting app using Django and JavaScript. JavaScript is used in order to dynamically load posts on the web page and replace HTML parts. I was following a a YouTube lesson [this video] to help me. Despite the fact that I have followed the tutorial on by one I am receiving the following Uncaught TypeError: Cannot read properties of undefined (reading 'length')at XMLHttpRequest.xhr.onload ((index):63:28). const postsElement = document.getElementById("posts") // get an html element // postsElement.innerHTML = 'Loading...' // set new html in that element // var el1 = "<h1>Hi there 1</h1>" // var el2 = "<h1>Hi the