我在pythonanywhere有一个Django站点。当我在Facebook上复制并粘贴网址以分享它时,我收到此错误:
如果单击该链接,则效果很好。我不知道如何访问ValueError的描述。
我在模板中尝试过这段代码,以便选择缩略图的图像:
<meta content="{{ object.image.url }}" property="og:image"/>
<meta content="TITLE" property="og:title"/>
<meta content="A description" property="og:description"/>
但它不起作用。 我使用facebook工具调试了,我得到了这个报告:
警告 - 应该修复的固定警告
Inferred Property The 'og:image' property should be explicitly provided, even if a value can be inferred from other tags. Bad Response Code URL returned a bad HTTP response code. Missing Required Property The og:type property is required, but not present. Inferred Property The 'og:url' property should be explicitly provided, even if a value can be inferred from other tags. Inferred Property The 'og:title' property should be explicitly provided, even if a value can be inferred from other tags. Inferred Property The 'og:description' property should be explicitly provided, even if a value can be inferred from other tags. Share App ID Missing The 'fb:app_id' property should be explicitly provided, Specify the app ID so that stories shared to Facebook will be properly attributed to the app. Alternatively, app_id can be set in url when open the share dialog.