Disqus comment box fails to appear on the screen

While going through the instructions provided on Disqus, I encountered an issue where the comment-box failed to render. Everything seemed to be correctly set up from the admin end on Disqus.

var disqus_config = function () {
   this.page.url = {{request.build_absolute_uri}}; // The placeholder text says | Replace PAGE_URL with your page's canonical URL variable
   this.page.identifier = {{instance.id}}; // article unique ID | Replace PAGE_IDENTIFIER with your page's unique identifier variable
};

The {{request.build_absolute_uri}} returns

http://localhost:8000/posts/*[post_title]*/
And the page identifier instance.id is an integer increasing by one for each post (e.g. 2)

I have configured the domain on Disqus to be http://localhost:8000/posts/ (as it currently leads to a 404 error without specifying a sub-url)

(function() { 
var d = document, s = d.createElement('script');

s.src = '//trydjango19.disqus.com/embed.js';

s.setAttribute('data-timestamp', +new Date());
(d.head || d.body).appendChild(s);
})();

In addition, I have included the comment count JS file and added #disqus_thread to all links on the homepage.

Answer №1

Is the javascript code provided correct?

this.page.url = {{request.build_absolute_uri}};

I believe that this.page.url should be a string. It might be necessary to enclose it in quotes. Similarly, instance.id should also be treated as a string based on the examples provided in the disqus documentation.

this.page.url = "{{request.build_absolute_uri}}";
this.page.identifier = "{{instance.id}}"; 

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Issue in Django admin page rendering occurs solely when attempting to add a new object that includes a datetime field within the fieldset

I have been developing a Django application to replace a sports picking game that I play with my friends. I initially defined my Game model some time ago, but recently I decided to add a datetime field to indicate the starting time of each game or match: ...

Developing a personalized logging service in NestJs: capturing logs without directly outputting them

I am currently working on developing a NestJs service that will enhance a Logger. However, I am facing issues with achieving the desired output (e.g., super.warn(); see below for more details). I have followed a tutorial from the nestjs site, but unfortuna ...

Creating a responsive dropdown submenu with Bootstrap 4, utilizing HTML, CSS, and jQuery

My HTML code includes CSS, jQuery Bootstrap 4 elements. I am attempting to add a dropdown submenu to my main menu when hovering over it. However, I am facing issues in getting the dropdown submenu to work properly. When I hover over main menu items like Co ...

Innovative User Handle Generation using Firebase in a React/Javascript Environment

My goal is to create new users using Firebase authentication and store their information in Firestore. Everything was going smoothly until I encountered the challenge of generating unique usernames. What would be the most effective approach to tackle this ...

Troubleshooting Custom Error Message Display Issue with Vee-validate and Zod in Vue 3 Composition API

I'm currently experimenting with using vee-validate alongside zod in my project, employing Composition API and custom error messages. One issue that I've encountered is that when I click into the input field and then quickly click outside of it, ...

Unable to establish connection via web socket with SSL and WSS in JavaScript

Below is the code I used to implement web socket: try { console.log('wss://' + hostname + ':' + port + endpoint); webSocket = new WebSocket(webSocketURL); webSocket.onmessage = function (event) { //c ...

Delay reading body until npm request completes

My current challenge involves using npm request and cheerio to extract webpages and analyze their HTML structure. Everything works smoothly in scenarios where the HTML is available upon request. However, I am facing a problem when a website initially displ ...

The internal cjs loader in node threw an error at line 1078

I'm encountering an error on Windows 10 when running the npm command: node:internal/modules/cjs/loader:1063 throw err; ^ Error: Cannot find module 'D:\mobile-version portfolio\ at Module._resolveFilename (node:internal/modules/cjs/load ...

Refresh all color pickers with Bootstrap 4 Colorpicker - enforce the update of every color selector

Currently, I am utilizing the Bootstrap 4 color picker library which can be found at this link: In my code, I have defined color pickers that look like this: <div class="input-group cpicker"> <input type="text" class="form-control input-lg" ...

How can JavaScript routes be used to apply specific code to multiple pages on a website?

Can you provide guidance on how to run the same code for multiple pages using routes? Below is an example I am currently exploring: var routeManager = { _routes: {}, // Collection of routes add: function(urls, action) { urls.forEach(fun ...

Updating the minimum date based on the user's previous selection using React JS and Material UI

In my material UI, I have two date pickers set up: From Date - <KeyboardDatePicker value={initialDateFrom} disableFuture={true} onChange={handleFromDateChange} > </KeyboardDatePicker> To Date - <KeyboardDatePicker value={initialDateTo} ...

Adjusting jQuery inputmask mask according to dropdown selection: A complete guide

I am utilizing jQuery inputmask to achieve a specific effect: Currently, I have set up a simple formatting for US & Canada phone numbers like this: $("#user_phone").inputmask("mask", { "mask": "(999) 999-9999" }); However, I want to dynamically chan ...

Is your Discord.js v14 string too long, surpassing the anticipated length of (1024)?

I'm encountering a string error with my serverinfo.js slash command that I haven't been able to resolve. It seems like the problem arises because the string exceeds the expected length (1024). Here's the specific error I encounter when runn ...

Exploring ways to overlay 2D text onto my Blender-created 3D model

Having created a 3D model with Blender, I am trying to overlay 2D text over the different meshes of the model. While I have successfully changed the colors of the meshes based on their indices using diffuse.color, I am struggling to draw text over my mesh. ...

Enhanced Slider Display featuring Multiple Posts for Improved Performance

My Sample Page features a slider that displays over 200 posts, each containing 5 images. However, the slider loads all the images at once, causing my page speed to be very slow. I am looking for an optimized way to display the slider without compromising l ...

How to disable sorting on the top LI element using jQuery?

I currently have two separate UL elements that are being sorted using the jQuery Sortable plugin. Each UL contains between one and ten LI elements arranged in a list format. $(".sortable").sortable({ connectWith: ".sortable", cancel: '.no-dra ...

When sending a POST request, the req.body.someElement parameter is not defined

Encountering an issue with a post request, as req.body is returning undefined values. Despite researching on Google and Stack Overflow, the provided solutions have not resolved the problem. Although logging the name shows a value, trying to access req.body ...

"Why does the React useState array start off empty when the app loads, but then gets filled when I make edits to the code

I'm facing a challenging task of creating a React card grid with a filter. The data is fetched from an API I developed on MySQL AWS. Each card has a .tags property in JSON format, containing an array of tags associated with it. In App.jsx, I wrote Jav ...

Locate the specific version of a JavaScript library within compiled JS files

The dist folder houses the results of running npm install. If I don't have access to the original package.json file used during the compilation of the distributable, how can I determine the version of a particular library that was utilized in the ins ...

Hiding labels using JQuery cannot be concealed

Why isn't this working? -_- The alert is showing, but nothing else happens. <asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeaderContent"> <script type="text/javascript"> if (navigator.userA ...