带附件和标签的TurboGears2的可插拔极简博客
tgapp-smallpress的Python项目详细描述
关于tgapp smallpress
SmallPress是TurboGears2的一个可插入的极简博客。 它实现了带有附件和标签支持的文章。 使用ckeditor进行内容编辑。
安装
tgapp smallpress既可以从pypi安装,也可以从bitbucket安装:
easy_install tgapp-smallpress
应该只对大多数用户有效
插入小型压力机
在应用程序中config/app_cfg.py导入plug:
from tgext.pluggable import plug
然后在文件的结尾用smallpress调用plug:
plug(base_config, 'smallpress')
再次运行paster setup app development.ini以创建 与smallpress相关的表并启动应用程序。 您可以访问 http://localhost:8080/smallpress。管理图形用户界面 将在用户登录时可用 smallpress组。
启用WooSh索引< < /H2>
小出版社在POST索引中存在BLUT。 如果您已经安装了它,它将用于执行索引。 在搜索功能中更好地查找的文章。
启用时,whoosh将其索引存储到/tmp/smallpress\u whoosh 您可以通过更改smallpress-whoosh索引来更改此路径。 配置文件中的变量。
多个博客支持
默认情况下,smallpress只支持一个blog,但它支持 初步的多博客实现。搜索和标记云将 被所有的博客分享,但是可以过滤文章 只管理一个博客的文章。
要创建博客访问/smallpress/blogs并创建新的访问, 然后您将能够访问子博客并通过访问 /smallpress/blogname
暴露部分
smallpress公开了一组可以使用的部分 在您的 应用程序:
- smallpress.partials:articles -> Renders the list of articles
- smallpress.partials:article_preview -> Renders the preview of an article
- smallpress.partials:tagcloud -> Renders the blog tagcloud section
- smallpress.partials:search -> Renders the blog search section
- smallpress.partials.excerpts -> Renders excerpts of a list of articles
- smallpress.partials.excerpt -> Renders the excerpt of an article
可用挂钩
smallpress公开了一些钩子和选项来配置 方面。
可传递给plug的选项调用:
- form -> Full python path of the form class to use for the Article form. By default smallpress.lib.forms.ArticleForm is used.
可与涡轮齿轮2寄存器挂钩一起使用的挂钩是:
- smallpress.before_create_article(article, values) -> Runs before the creation of an article
- smallpress.after_create_article(article, values) -> Runs after the creation of an article, makes possible to set additional data for newly created articles
- smallpress.before_edit_article(article, values) -> Runs before displaying the edit article form, makes possible to load additional form values
- smallpress.before_save_article(article, values) -> Runs before saving the article after it got edited, makes possible to update additional data for the article.