Skip to content
Related Articles

Related Articles

Improve Article
Integrating Facebook Like & Share Plugin Using Django
  • Last Updated : 16 Feb, 2021

Django is a Python-based web framework that allows you to quickly create efficient web applications. It is also called batteries included framework because Django provides built-in features for everything including Django Admin Interface, default database – SQLlite3, etc.  In this article we will learn to integrate facebook comment plugin in django.

How to Integrate Facebook Like & Share Plugin in Django ?


pip install django

1) Create new project

django-admin startproject Test_prj

2) Navigate to Test_prj directory

cd Test_prj

3) Create new app

python startapp main

Folder Structure :

Then add the app name inside the  INSTALLED_APPS (


from django.shortcuts import render
# Create your views here.
def home(request):
    return render(request,"main/index.html")

Create new file inside the main directory


from django.urls import path
from .views import *
urlpatterns = [

Add the main/ inside the


from django.contrib import admin
from django.urls import path,include
urlpatterns = [

Go to this link to get code

Click on get code

Create new directory  templates inside the main app inside that create main directory



<!DOCTYPE html>
    <div id="fb-root"></div>
    <script async defer crossorigin="anonymous" 
    <h1>Welcome To GFG</h1>
    <div class="fb-like" data-href="" data-width=""
         data-layout="button_count" data-action="like" data-size="large" 

Open cmd or terminal to run this app

python runserver


 Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.  

To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course. And to begin with your Machine Learning Journey, join the Machine Learning – Basic Level Course

My Personal Notes arrow_drop_up
Recommended Articles
Page :