Django WordPress的非WordPress扩展集合(真实的)

the-real-django-wordpress-extras的Python项目详细描述


一组有用的非wordpress扩展 Django WordPress(真正的那个)。

pip install the-real-django-wordpress-extras

wordpressext添加到settings.py中已安装的应用程序。

请务必将wordpressext放在url中wordpress上方。py:

urlpatterns += patterns('',
    ...
    url(r'^blog/', include('wordpressext.urls')),
    url(r'^blog/', include('wordpress.urls')),
    ...
)

电子邮件发件人按以下顺序确定:

  1. settings.WPEXT_SENDER email address
  2. settings.POSTMARK_SENDER if Postmark settings are configured and WPEXT_SENDER does not exist
  3. settings.ADMINS the first admin email address, if POSTMARK_SENDER does not exist

功能

parse.ly元模板标记

生成Parse.ly元标记:

{% parselymeta post %}

取消评论通知

这是目前唯一的功能!而且只执行了一半!

如果使用Disqus作为注释,则可以提供 post comment javascript钩子通知post作者新的注释。 下面是一些可以启用注释通知的javascript示例:

var newComment = function(comment) {
    var url = window.location.href + "disqus/";
    var params = {
        id: comment.id,
        text: comment.text,
        csrfmiddlewaretoken: csrftoken  // you'll have to get this from somewhere
    };
    $.post(url, comment, function(data) {
        // don't really need to do anything
    });
};

var disqus_config = function() {
    this.callbacks.onNewComment = [function(comment) { newComment(comment); }];
};

注释终结点位于<path_to_blog>/<year>/<month>/<day>/<slug>/disqus/。它接受以下post参数:

  • id the Disqus ID of the comment
  • text the text of the comment
  • csrfmiddlewaretoken a CSRF token, if protection is enabled

请参阅onNewComment回调,了解如何实现自己的回调。

未来的版本将连接到discusapi来完成各种任务。

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
尝试通过java驱动程序连接时,mongodb服务器上的SSLhandshake失败   使用PlayFramework的Azure网站中的java Logback   java在另一个ArrayList中使用ArrayList处理复杂的JSON响应   java无法在另一台机器上运行eclipse tomcat中的war文件   java GZIPOutputStream有什么替代方案吗?   java Nashorn调试在Nashorn中运行的javascript   java文本短信未发送,即使toast显示已发送   java Hibernatesearch 5.0 spatial不确定是否在散列中存储lat/lon   java我想创建一个带有文本视图的计数器   java安卓:如何正确地同步资源   java使用mockito。当不知道方法调用的参数时   firebase Java使用HTTP v1发送错误字符的中文通知   java Hibernate无法映射到表?   java使用对象映射器解析复杂JSON   java Selenium Grid 2并行测试用例执行   java所有项目在列表视图中重复