Saturday, 31 August 2013

facebook comments in django: url unreachable warning

facebook comments in django: url unreachable warning

So, I have this small django blog (django newbie here) I have made (as per
thr tutorials of django) and I then decided to add facebook comments to
this. So, I went to the plugin page of facebook and did a "get code". Now,
my page looks like so:
<body>
{% block facebookcomments %}
<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src =
"//connect.facebook.net/en_GB/all.js#xfbml=1&appId=375557716230123";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
{% endblock facebookcomments %}
and then, in the places where I need the comments to show up, I first
declare the meta content required by facebook like so:
{% block metacontent %}
{{ block.super }}
<meta property="og:site_name" content="first django blog" >
<meta property="og:type" content="website" >
<meta property="og:title" content="{{ detailobject.title|truncatechars:50
}}" >
{% if "None found" not in detailobject.blog_desc %}
<meta property="og:description" content="
{{ detailobject.blog_desc|truncatechars:100 }}" >
{% else %}
<meta property="og:description" content="
blog description goes here {{ detailobject.title|truncatechars:100 }}" >
{% endif %}
<meta property="og:url" content="{{ request.build_absolute_uri }}" >
<meta property="og:image" content="{% static
'docs/assets/ico/fbcomments.png' %}" >
{% endblock metacontent %}
and finally, the comments plugin is initialized like so:
<div class="fb-comments"
data-href = "{{ request.build_absolute_uri|urlencode:"" }}"
data-width = "600"
data-num-posts = "10"
colorscheme = "light">
</div>
..the problem is, on everypage I have facebook comments, I get an annoying
message at the bottom of the comments plugin saying:
"Warning URL "...." is unreachable"
where "..." is the URL of the page.
I have tried debugging it to no effect (there are no error or warning
messages for the page on fb debugger - initially it said it needed og:url
etc.. once I fixed them, I see no errors/warning on fb debugger, but the
warning still remains).
I am totally confused now how to get rid of this error. The funny thing is
that I do not get this warning on my devel environment - but get this in
production type environment.
I would really appreciate if anyone could guide me in the right direction
to solve this issue. I am beginning to think that I am not using the FB
Javascriot SDK correctly - not sure if all I need is the JS code above or
if I need to include it as shown here

No comments:

Post a Comment