Create a Project Directory and Open in VS Code
Create a Project directory through either your file manager or any terminal interface.
Setting Up Virtual Environment(Optional)
Setting up a virtual environment for your Django app is a good practice as it allows you to isolate dependencies for each project, preventing conflicts between different projects. Here’s how you can set up a virtual environment for your Django app:
Install Virtualenv
pip install virtualenv
Create and Activate Virtual Environment
Navigate to your project directory in the terminal and create a virtual environment using virtualenv. Replace myenv with your preferred name for the virtual environment.
virtualenv myenv
myenv\Scripts\activate
Create Social Media Feed App using Django
In this tutorial, we’ll build a basic social media feed using Django, the Python web framework. A social media feed is a core component of platforms like Facebook, Instagram, and Twitter, allowing users to view and interact with posts, comments, and likes in real-time. By the end of this tutorial, you’ll have a fully functional social media feed where users can:
- Signup or Login
- Post, Like & Comment
- Search other users
- Manage profile
Table of Content
- Create a Project Directory and Open in VS Code
- Setting Up Django Project and App
- Install Django
- Create a Django Project
- Create a Django App
- Install and Setup django-bootstrap-v5 Package
- Create urls.py file in “core” app:
- Writing our Logic in the views.py file
- Writing the urls.py file in core app
- Writing Models in models.py
- Writing forms.py file
- Creating all required HTML Templates
- Wrting the admin.py file
- Making Migrations and Creating Super User
- Testing our Social Media Feed