I'm new to python and so django. I built a simple blog with models including "Entry" and "Author". Now, I've been told that the blog will make use of "disqus" for comments and so I should give some identifier or site id at backend so that disqus can be used. I can not figure it out how to do it. Though, I saw its functionality by adding the universal code (provided by disqus) to my blog on Blogger.
my models are:
class Author(models.Model):
userName = models.CharField(max_length=50)
displayName=models.CharField(max_length=100)
email = models.EmailField()
def __str__(self):
return self.displayName
class Entry(models.Model):
title = models.CharField(max_length=255)
body = MarkdownField()
image=models.ImageField(upload_to='images',null=True,blank=True)
category=models.ManyToManyField(Category)
createdAt = models.DateTimeField(auto_now_add=True)
updatedAt = models.DateTimeField(auto_now=True)
authors = models.ManyToManyField(Author)
publish=models.BooleanField(default=True)
def __str__(self):
return self.title
class Meta:
verbose_name = "Blog Entry"
verbose_name_plural = "Blog Entries"
ordering = ["-createdAt"]
my views are:
class EntryView(viewsets.ModelViewSet):
queryset=Entry.objects.all()
serializer_class=EntrySerializer
lookup_field = 'title'
paginate_by= 6
class AuthorView(viewsets.ModelViewSet):
queryset=Author.objects.all()
serializer_class=AuthorSerializer
how can I add disqus to my blog?