Video Tutorial

Code on Github

In this tutorial, we will add some extra features to our direct messages. We will add a notification when a user receives a message, we will add an alert if a thread is created with a username that doesn’t exist. We will also add the ability to upload images inside of messages as well. Finally, we will change some CSS styles as well. Let’s get started by adding a notification when a message is created.

Adding a Notification for Messages

First we need to add another notification type, we will need to add a thread field and we will add…


Video Tutorial

In this tutorial we are going to start to add direct messages between users. In this part we will get it working with it’s basic functionality and then we will come back and add some extra features to it next. This will not be a real time chat, to do that would be more complicated and would require something like Django channels. If there is any interest in that, I could come back later and update it to include that. However for now, we won’t do that. …


Video Tutorial

Code on Github

In this tutorial, we are going to add more to our social network application. This time we will add the ability to upload a image in a post. We will add a button to select a file and then we will show it above the text of the post. We will need to make some updates to our PostModel to handle this. Let’s first start with fixing a small bug in the social feed.

Fixing a Social Feed Bug

The first thing to do is to fix the issue with our social feed, there is an issue where the posts…


Video Tutorial

Code on Github

In this tutorial, we are going to add user notifications to our social media app. We will set up notifications that will be in the navigation bar that will list all unseen notifications. For our app, we will count a notification as unseen if they haven’t clicked on it. This will definitely be more involved and not as simple as the previous changes we have made. To make this all work we will mix in a little Javascript and custom Django template tags.

Move the Javascript Script Tag

First let’s fix something that we had from a previous tutorial. We…


Video Tutorial

Code on Github

There will be a couple more tutorials for this social network, in this one we will add the ability to like/dislike comments and reply to comments. We won’t keep adding replies to replies, etc but we will allow the comments directly on the post to have replies. Let’s get started by adding likes and dislikes to the comment model.

Adding Likes and Dislikes to Comments

We need to add the same thing that we had in our Post model for the likes and dislikes, this will look almost exactly the same. We just need to change the related_name to be something…


Video Tutorial

Code on Github

In this tutorial, we are going to finish up making some small final improvements to the application. This time, we are going to add a way to view a list of followers, we will improve the profile styles, and we will fix an issue with the navbar profile link. Let’s start with adding a followers list.

Adding a List of Followers

First we need to create a new view to get all of the followers. This will be very similar to other views that we have created. We will use the generic view class and get the profile from the…


Video Tutorial

Code on Github

This will be part 1 of two tutorials where we will put some final improvements on our social media application. We have most of the functionality done at this point, we just need to clean some things up and add a couple of additions to improve the user experience. In this first tutorial, we will add an external style sheet to clean up our templates, we will filter the social feed to only show posts by those users that we follow, and we will update some of the header text for the posts and comments.

External CSS


Video Tutorial

Code on Github

In this tutorial, we are going to get the user search bar that has been in our navbar working. We will use the Q object that comes with Django to get this working. We will need to make some changes to our navbar first.

Updating the Navbar

We need to add a method and an action to the form, this action url isn’t created yet, but we will name the url pattern the same as this when we create it later. We also need to add a submit button, for this we will use a font awesome icon…


Video Tutorial

Code on Github

In this tutorial, we are going to add the ability to like and dislike posts. To do this, we will store a list of users that clicked the like or the dislike button. We will add some checks to make sure that the user can only like or dislike a post once and they can only either like or dislike a post and not both at the same time. First we need a place to store this data, we will add that to our Post model.

Add to The Models.py

This will look very similar to how we added…


Video Tutorial

Code on Github

In this tutorial we are going to add the ability to follow and unfollow users. We will create two simple views that will handle the logic for this. We will need to update our models.py to have a field to store the followers for each user. Before we do this, we are going to update the post lists to have a link to go straight to the profile.

Adding a Profile Link on the Post Lists

First, we want to add a link to easily access the profile of each user. We will do this by changing the post lists in the…

LegionScript

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store