Package: django-fluent-blogs
django-fluent-blogsThis is a basic blogging engine, with the following features:Archive views by date, author, category and tags.Contents filled bydjango-fluent-contentsRSS and Atom feedsGranularity in templates to override layouts.Abstract base model for custom blog models.Used applications:Categories based ondjango-categories-i18n(ordjango-categories).Optionalcomments based ondjango-contrib-commentsOptionalmultilingual support based ondjango-parler.Optionalintegration withdjango-taggitanddjango-taggit-autocomplete-modifiedfor tag supportOptionalintegration withdjango-fluent-commentsfor Ajax-based commentsOptionalintegration withdjango-fluent-pagesOptionalintegration withdjango.contrib.sitemapsTODO:Have integration with blog publication protocols (likedjango-blog-zinniaprovides), built in a similar way likedjango.contrib.syndicationworks.InstallationFirst install the module, preferably in a virtual environment:pipinstalldjango-fluent-blogs# Install the plugins of fluent-contents that you use:pipinstalldjango-fluent-contents[text]# Optional: to add tagging support + autocomplete use:pipinstalldjango-taggitdjango-taggit-autocomplete-modifiedConfigurationAdd the applications tosettings.py:INSTALLED_APPS+=(# Blog engine'fluent_blogs',# The content plugins'fluent_contents','fluent_contents.plugins.text',# Support libs'categories_i18n','django_wysiwyg','slug_preview',# Optional commenting support'django_comments',# Optional tagging'taggit','taggit_autocomplete_modified',)DJANGO_WYSIWYG_FLAVOR="yui_advanced"Note that not all applications are required;
tagging is optional, and so are the variousfluent_contents.plugin.*packages.Include the apps inurls.py:urlpatterns+=patterns('',url(r'^admin/util/taggit_autocomplete_modified/',include('taggit_autocomplete_modified.urls')),url(r'^blog/comments/',include('django_comments.urls')),url(r'^blog/',include('fluent_blogs.urls')),)The database can be created afterwards:./manage.py migrateIn case additional plugins ofdjango-fluent-contentsare used, follow theirinstallation instructionsas well.
Typically this includes:adding the package name toINSTALLED_APPS.runningpip installdjango-fluent-contents[pluginname]running./manage.py syncdbConfiguring the templatesTo display the blog contents, afluent_blogs/base.htmlfile needs to be created.
This will be used to map the output of the module to your site templates.The base template needs to have the blocks:content- displays the main contenttitle- the<head>title fragment.link- displays<link>tags for RSS feeds.script- includes additional<script>tags.meta-description- thevalueof the meta-description tag.meta-keywords- thevaluefor the meta-keywords tag.og-type- the OpenGraph type for Facebook (optional)og-descriptionthe OpenGraph description for Facebook (optional)Thefluent_blogs/base.htmltemplate could simply remap the block names to the site’sbase.htmltemplate.
For example:{%extends"base.html"%}{%blockheadtitle%}{%blocktitle%}{%endblock%}{%endblock%}{%blockmain%}{# This area is filled with the blog archive/details:
    {% block content %}{% endblock %}

    {# Add any common layout, e.g. a sidebar here #}{%endblock%}When all other block names are already available in the site’sbase.htmltemplate,
this example should be sufficient.The filename of the base template can also be changed by defining theFLUENT_BLOGS_BASE_TEMPLATEsetting.CommentsThe commenting support can be based ondjango-contrib-comments, or any other system of your choice.
To integratedjango-contrib-commentswith your site theme, also create acomments/base.htmltemplate that maps the blocks:titlecontentextrahead(only fordjango-fluent-comments)Adding pages to the sitemapOptionally, the blog pages can be included in the sitemap.
Add the following inurls.py:fromfluent_blogs.sitemapsimportEntrySitemap,CategoryArchiveSitemap,AuthorArchiveSitemap,TagArchiveSitemapsitemaps={'blog_entries':EntrySitemap,'blog_categories':CategoryArchiveSitemap,'blog_authors':AuthorArchiveSitemap,'blog_tags':TagArchiveSitemap,}urlpatterns+=patterns('',url(r'^sitemap.xml$','django.contrib.sitemaps.views.sitemap',{'sitemaps':sitemaps}),)Integration with django-fluent-pages:To integrate with the page types ofdjango-fluent-pages, don’t includefluent_blogs.urlsin the URLconf:urlpatterns+=patterns('',url(r'^admin/util/taggit_autocomplete_modified/',include('taggit_autocomplete_modified.urls')),url(r'^blog/comments/',include('django_comments.urls')),# or fluent_comments.urls)Instead, add a page type instead:INSTALLED_APPS+=('fluent_pages','fluent_blogs.pagetypes.blogpage',)A “Blog” page can now be created in the page tree ofdjango-fluent-pagesat the desired URL path.Integration with django-fluent-comments:To use Ajax-based commenting features ofdjango-fluent-comments, include it insettings.py:INSTALLED_APPS+=('fluent_blogs','fluent_comments',# Before django_comments'django_comments',...)Include the proper module inurls.py:urlpatterns+=patterns('',url(r'^blog/comments/',include('fluent_comments.urls')),...)This module will detect the installation, and enable the moderation features and include
the required CSS and JavaScript files to have a Ajax-based commenting system.Integration with other commenting systemsTo use a different commenting system instead ofdjango-contrib-comments(e.g.DISQUSorFacebook-comments), override the following templates:fluent_blogs/entry_detail/comments.htmlThese CSS/JavaScript includes are generated using:fluent_blogs/entry_detail/comments_css.htmlfluent_blogs/entry_detail/comments_script.htmlOverriding the blog layoutTo change the layout of the blog , the following templates can be overwritten:In the archive/list page:fluent_blogs/entry_archive.html- the starting point, which includes all sub templates:fluent_blogs/entry_archive/item.html- a single list item (extendsfluent_blogs/entry_contents_base.html).fluent_blogs/entry_archive/empty.html- the default message when there are no entries.fluent_blogs/entry_archive/pagination.html- the pagination at the bottom of the page.In the detail page:fluent_blogs/entry_detail.html- the starting point, which includes all sub templates:fluent_blogs/entry_detail/contents.html- the entry contents (extendsfluent_blogs/entry_contents_base.html).fluent_blogs/entry_detail/widgets.html- space to add Social Media buttons.fluent_blogs/entry_detail/comments.html- the comments.fluent_blogs/entry_detail/navigation.html- the entry navigation linksfluent_blogs/entry_detail/page_footer.html- space below the comments to add Social Media buttons.fluent_blogs/entry_detail/comments_css.htmlfluent_blogs/entry_detail/comments_script.htmlCommon appearance:fluent_blogs/entry_contents_base.html- the common appearance of entries in the archive and detail page.fluent_blogs/base.html- the base template, e.g. to introduce a common sidebar.Shared entry layoutWhen the layout of individual entries is shared withBy default, the contentsfluent_blogs/entry_archive/item.htmland , based onfluent_blogs/entry_archive/item.htmlby defaultCustom entry modelsThis applications supports the use of custom models for the blog entries.
Include the following setting in your project:FLUENT_BLOGS_ENTRY_MODEL='myapp.ModelName'This application will use the custom model for feeds, views and the sitemap.
The model can either inherit from the following classes:fluent_blogs.models.Entry(the default entry)fluent_blogs.base_models.AbstractEntry(the default entry, as abstract model)A mix offluent_blogs.base_models.AbstractEntryBasecombined with:fluent_blogs.base_models.ExcerptEntryMixinfluent_blogs.base_models.ContentsEntryMixinfluent_blogs.base_models.CommentsEntryMixinfluent_blogs.base_models.CategoriesEntryMixinfluent_blogs.base_models.TagsEntryMixinWhen a custom model is used, the admin needs to be registered manually.
The admin can inherit from either:fluent_blogs.admin.AbstractEntryBaseAdminfluent_blogs.admin.EntryAdminThe views are still rendered using the same templates, but you can also override:myapp/modelname_archive_*.htmlmyapp/modelname_detail.htmlmyapp/modelname_feed_description.htmlContributingThis module is designed to be generic, and easy to plug into your site.
In case there is anything you didn’t like about it, or think it’s not
flexible enough, please let us know. We’d love to improve it!If you have any other valuable contribution, suggestion or idea,
please let us know as well because we will look into it.
Pull requests are welcome too. :-)