2014-02-25 13:46:50 +00:00
|
|
|
==============
|
2014-01-05 09:34:10 +00:00
|
|
|
djangocms-blog
|
2014-02-25 13:46:50 +00:00
|
|
|
==============
|
2014-01-05 09:34:10 +00:00
|
|
|
|
2015-10-17 13:55:54 +00:00
|
|
|
.. image:: https://img.shields.io/pypi/v/djangocms-blog.svg?style=flat-square
|
|
|
|
:target: https://pypi.python.org/pypi/djangocms-blog
|
|
|
|
:alt: Latest PyPI version
|
2014-08-29 03:59:12 +00:00
|
|
|
|
2015-10-17 13:55:54 +00:00
|
|
|
.. image:: https://img.shields.io/pypi/dm/djangocms-blog.svg?style=flat-square
|
|
|
|
:target: https://pypi.python.org/pypi/djangocms-blog
|
|
|
|
:alt: Monthly downloads
|
2015-02-08 21:46:28 +00:00
|
|
|
|
2015-10-17 13:55:54 +00:00
|
|
|
.. image:: https://img.shields.io/pypi/pyversions/djangocms-blog.svg?style=flat-square
|
|
|
|
:target: https://pypi.python.org/pypi/djangocms-blog
|
|
|
|
:alt: Python versions
|
2014-06-11 11:05:41 +00:00
|
|
|
|
2015-10-17 13:55:54 +00:00
|
|
|
.. image:: https://img.shields.io/travis/nephila/djangocms-blog.svg?style=flat-square
|
|
|
|
:target: https://travis-ci.org/nephila/djangocms-blog
|
|
|
|
:alt: Latest Travis CI build status
|
2014-06-11 19:34:56 +00:00
|
|
|
|
2015-10-17 13:55:54 +00:00
|
|
|
.. image:: https://img.shields.io/coveralls/nephila/djangocms-blog/master.svg?style=flat-square
|
|
|
|
:target: https://coveralls.io/r/nephila/djangocms-blog?branch=master
|
|
|
|
:alt: Test coverage
|
2014-01-05 09:34:10 +00:00
|
|
|
|
2015-10-18 16:02:06 +00:00
|
|
|
.. image:: https://img.shields.io/codecov/c/github/nephila/djangocms-blog/develop.svg?style=flat-square
|
2015-10-17 13:55:54 +00:00
|
|
|
:target: https://codecov.io/github/nephila/djangocms-blog
|
|
|
|
:alt: Test coverage
|
|
|
|
|
|
|
|
.. image:: https://codeclimate.com/github/nephila/djangocms-blog/badges/gpa.svg?style=flat-square
|
2015-09-01 08:35:54 +00:00
|
|
|
:target: https://codeclimate.com/github/nephila/djangocms-blog
|
|
|
|
:alt: Code Climate
|
|
|
|
|
2016-02-02 10:36:08 +00:00
|
|
|
django CMS blog application - Support for multilingual posts, placeholders, social network meta tags and configurable apphooks.
|
2014-02-25 13:46:50 +00:00
|
|
|
|
2014-06-11 11:01:39 +00:00
|
|
|
Supported Django versions:
|
|
|
|
|
|
|
|
* Django 1.6
|
2014-12-05 20:17:27 +00:00
|
|
|
* Django 1.7
|
2015-07-21 06:27:49 +00:00
|
|
|
* Django 1.8
|
2016-05-03 06:37:18 +00:00
|
|
|
* Django 1.9
|
2014-06-11 11:01:39 +00:00
|
|
|
|
|
|
|
Supported django CMS versions:
|
|
|
|
|
2015-05-18 06:35:17 +00:00
|
|
|
* django CMS 3.x
|
2014-06-11 11:01:39 +00:00
|
|
|
|
2016-05-18 06:34:03 +00:00
|
|
|
.. warning:: Version 0.8 will be the last one supporting Python 2.6, Python 3.3,
|
2016-05-29 16:53:20 +00:00
|
|
|
Django<1.8 and django CMS<3.2.
|
2016-05-18 06:34:03 +00:00
|
|
|
|
2016-04-08 16:53:08 +00:00
|
|
|
.. warning:: Starting from version 0.8, date_published is not set anymore
|
|
|
|
when creating a post but rather when publishing.
|
|
|
|
This does not change the overall behavior, but be warned if you
|
|
|
|
expect it to be not null in custom code.
|
2015-08-14 17:22:00 +00:00
|
|
|
|
|
|
|
.. warning:: Version 0.6 changes the field of LatestPostsPlugin.tags field.
|
|
|
|
A datamigration is in place to migrate the data, but check that
|
|
|
|
works ok for your project before upgrading, as this might delete
|
|
|
|
some relevant data.
|
2016-01-18 19:08:25 +00:00
|
|
|
Some plugins have a broken tag management prior to 0.6, in case
|
|
|
|
you have issues with tags, upgrade to latest version to have it fixed.
|
2014-12-05 14:52:37 +00:00
|
|
|
|
2016-09-10 19:46:43 +00:00
|
|
|
*****************************************
|
2016-06-25 15:32:45 +00:00
|
|
|
Upgrading cmsplugin-filer from 1.0 to 1.1
|
2016-09-10 19:46:43 +00:00
|
|
|
*****************************************
|
2016-06-25 15:32:45 +00:00
|
|
|
|
|
|
|
Due to changes in cmsplugin-filer/filer which moved ``ThumbnailOption`` model from the
|
|
|
|
former to the latter, ``djangocms-blog`` must be migrated as well.
|
|
|
|
|
|
|
|
Migrating cmsplugin-filer to 1.1 and djangocms-blog up to 0.8.4
|
|
|
|
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
|
|
|
|
|
|
|
If you have djangocms-blog up to 0.8.4 (included) installed or you are upgrading from a previous
|
|
|
|
djangocms-blog version together with cmsplugin-filer upgrade, you can just apply the migrations::
|
|
|
|
|
2017-03-06 20:58:52 +00:00
|
|
|
pip install cmsplugin-filer==1.1.3 django-filer==1.2.7 djangocms-blog==0.8.4
|
2016-06-25 15:32:45 +00:00
|
|
|
python manage.py migrate
|
|
|
|
|
|
|
|
Migrating cmsplugin-filer to 1.1 and djangocms-blog 0.8.5+
|
|
|
|
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
|
|
|
|
2017-03-06 20:58:52 +00:00
|
|
|
If you already a djangocms-blog 0.8.5+ up to 0.8.11, upgrade to 0.8.11, then
|
|
|
|
you have to de-apply some blog migrations when doing the upgrade::
|
2016-06-25 15:32:45 +00:00
|
|
|
|
2017-03-06 20:58:52 +00:00
|
|
|
pip install djangocms-blog==0.8.11
|
2016-06-25 15:32:45 +00:00
|
|
|
python manage.py migrate djangocms_blog 0017 ## reverse for these migration is a noop
|
2017-03-06 20:58:52 +00:00
|
|
|
pip install cmsplugin-filer==1.1.3 django-filer==1.2.7
|
2016-06-25 15:32:45 +00:00
|
|
|
python manage.py migrate
|
|
|
|
|
2017-03-06 20:58:52 +00:00
|
|
|
After this step you can upgrade to 0.8.12::
|
|
|
|
|
|
|
|
pip install djangocms-blog==0.8.12
|
|
|
|
|
2016-06-25 15:32:45 +00:00
|
|
|
.. note:: de-apply migration **before** upgrading cmsplugin-filer. If running before upgrade, the
|
|
|
|
backward migration won't alter anything on the database, and it will just allow the code
|
|
|
|
to migrate ``ThumbnailOption`` from cmsplugin-filer to filer
|
|
|
|
|
2017-03-06 20:58:52 +00:00
|
|
|
.. note:: If you upgrade in a Django 1.10 environment, be sure to upgrade both packages
|
|
|
|
at the same time to allow correct migration dependencies to be evaluated.
|
|
|
|
|
|
|
|
Installing djangocms-blog in an existing project with Django 1.10
|
|
|
|
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
|
|
|
|
|
|
|
If your project has cmsplugin-filer 1.1+ already installed and it uses Django 1.10,
|
|
|
|
install djangocms-blog 0.8.12 (and above)::
|
|
|
|
|
|
|
|
pip install djangocms-blog==0.8.12
|
2016-06-25 15:32:45 +00:00
|
|
|
|
2016-09-10 19:46:43 +00:00
|
|
|
********
|
2015-10-18 08:49:45 +00:00
|
|
|
Features
|
2016-09-10 19:46:43 +00:00
|
|
|
********
|
2015-10-18 08:49:45 +00:00
|
|
|
|
|
|
|
* Placeholder content editing
|
2016-03-01 08:48:06 +00:00
|
|
|
* Frontend editing using django CMS 3.x frontend editor
|
2015-10-18 08:49:45 +00:00
|
|
|
* Multilingual support using django-parler
|
|
|
|
* Support for Twitter cards, Open Graph and Google+ snippets meta tags
|
|
|
|
* Optional support for simpler TextField-based content editing
|
|
|
|
* Multisite support (posts can be visible in one or more Django sites on the
|
|
|
|
same project)
|
|
|
|
* Per-Apphook configuration
|
2015-10-31 01:06:57 +00:00
|
|
|
* Configurable permalinks
|
|
|
|
* Configurable django CMS menu support
|
2015-10-18 08:49:45 +00:00
|
|
|
* Per-Apphook templates set
|
|
|
|
* Auto Apphook setup
|
2015-10-31 01:06:57 +00:00
|
|
|
* Django sitemap framework support
|
2015-10-25 19:10:25 +00:00
|
|
|
* Support for django CMS 3.2+ Wizard
|
|
|
|
* Haystack index support
|
2014-12-05 14:52:37 +00:00
|
|
|
|
2016-09-10 19:46:43 +00:00
|
|
|
**********
|
2014-01-05 09:34:10 +00:00
|
|
|
Quickstart
|
2016-09-10 19:46:43 +00:00
|
|
|
**********
|
2014-01-05 09:34:10 +00:00
|
|
|
|
|
|
|
Install djangocms-blog::
|
|
|
|
|
2014-09-27 09:04:49 +00:00
|
|
|
pip install djangocms-blog
|
2014-01-05 09:34:10 +00:00
|
|
|
|
2015-12-06 18:25:00 +00:00
|
|
|
or -when installing in Django 1.6/1.7::
|
|
|
|
|
|
|
|
pip install djangocms-blog[admin-enhancer]
|
|
|
|
|
2014-03-06 19:09:37 +00:00
|
|
|
Add ``djangocms_blog`` and its dependencies to INSTALLED_APPS::
|
2014-01-05 09:34:10 +00:00
|
|
|
|
2014-03-06 19:09:37 +00:00
|
|
|
INSTALLED_APPS = [
|
|
|
|
...
|
|
|
|
'filer',
|
2014-08-19 17:28:09 +00:00
|
|
|
'easy_thumbnails',
|
2016-01-18 19:07:25 +00:00
|
|
|
'aldryn_apphooks_config',
|
2014-08-19 17:28:09 +00:00
|
|
|
'cmsplugin_filer_image',
|
2014-03-06 19:09:37 +00:00
|
|
|
'parler',
|
|
|
|
'taggit',
|
|
|
|
'taggit_autosuggest',
|
2014-06-12 16:23:24 +00:00
|
|
|
'meta',
|
2014-08-19 17:28:09 +00:00
|
|
|
'djangocms_blog',
|
2014-03-06 19:09:37 +00:00
|
|
|
...
|
|
|
|
]
|
|
|
|
|
2015-12-23 10:51:00 +00:00
|
|
|
If you installed the **admin-enhancer** variant, add ``admin_enhancer`` to ``INSTALLED_APPS``::
|
2015-12-06 18:25:00 +00:00
|
|
|
|
|
|
|
INSTALLED_APPS = [
|
|
|
|
...
|
|
|
|
'admin_enhancer',
|
|
|
|
...
|
|
|
|
]
|
|
|
|
|
|
|
|
|
2014-03-06 19:09:37 +00:00
|
|
|
Then sync and migrate::
|
|
|
|
|
|
|
|
$ python manage.py syncdb
|
|
|
|
$ python manage.py migrate
|
|
|
|
|
2014-06-12 16:23:24 +00:00
|
|
|
External applications configuration
|
|
|
|
+++++++++++++++++++++++++++++++++++
|
|
|
|
|
|
|
|
Dependency applications may need configuration to work properly.
|
|
|
|
|
|
|
|
Please, refer to each application documentation on details.
|
|
|
|
|
|
|
|
* django-filer: http://django-filer.readthedocs.org
|
|
|
|
* django-meta: https://github.com/nephila/django-meta#installation
|
2015-10-18 08:49:45 +00:00
|
|
|
* django-meta-mixin: https://github.com/nephila/django-meta-mixin#installation
|
2014-08-24 04:34:34 +00:00
|
|
|
* django-parler: http://django-parler.readthedocs.org/en/latest/quickstart.html#configuration
|
2014-06-12 16:23:24 +00:00
|
|
|
* django-taggit-autosuggest: https://bitbucket.org/fabian/django-taggit-autosuggest
|
|
|
|
|
|
|
|
Quick hint
|
|
|
|
++++++++++
|
|
|
|
|
|
|
|
The following are minimal defaults to get the blog running; they may not be
|
|
|
|
suited for your deployment.
|
|
|
|
|
2015-10-01 06:15:37 +00:00
|
|
|
* Add the following settings to your project::
|
2014-06-13 16:24:39 +00:00
|
|
|
|
2014-06-12 16:23:24 +00:00
|
|
|
SOUTH_MIGRATION_MODULES = {
|
2014-06-20 11:14:06 +00:00
|
|
|
'easy_thumbnails': 'easy_thumbnails.south_migrations',
|
2014-06-12 16:23:24 +00:00
|
|
|
'taggit': 'taggit.south_migrations',
|
|
|
|
}
|
|
|
|
THUMBNAIL_PROCESSORS = (
|
|
|
|
'easy_thumbnails.processors.colorspace',
|
|
|
|
'easy_thumbnails.processors.autocrop',
|
|
|
|
'filer.thumbnail_processors.scale_and_crop_with_subject_location',
|
|
|
|
'easy_thumbnails.processors.filters',
|
|
|
|
)
|
|
|
|
META_SITE_PROTOCOL = 'http'
|
|
|
|
META_USE_SITES = True
|
2015-10-01 06:15:37 +00:00
|
|
|
|
2016-03-01 08:48:06 +00:00
|
|
|
* If you are using Django 1.7+, be aware that ``filer`` < 0.9.10,
|
2015-10-18 08:49:45 +00:00
|
|
|
``cmsplugin_filer`` and ``django-cms`` < 3.1 currently requires you to
|
|
|
|
setup ``MIGRATION_MODULES`` in settings::
|
2015-10-01 06:15:37 +00:00
|
|
|
|
2015-03-02 06:10:55 +00:00
|
|
|
MIGRATION_MODULES = {
|
2015-06-11 16:00:12 +00:00
|
|
|
'cms': 'cms.migrations_django', # only for django CMS 3.0
|
|
|
|
'menus': 'menus.migrations_django', # only for django CMS 3.0
|
2015-10-18 08:49:45 +00:00
|
|
|
'filer': 'filer.migrations_django', # only for django filer up to 0.9.9
|
2015-03-02 06:10:55 +00:00
|
|
|
'cmsplugin_filer_image': 'cmsplugin_filer_image.migrations_django',
|
|
|
|
}
|
2015-10-01 06:15:37 +00:00
|
|
|
|
2015-03-02 06:17:41 +00:00
|
|
|
Please check
|
|
|
|
`django CMS installation <http://django-cms.readthedocs.org/en/support-3.0.x/how_to/integrate.html#installing-and-configuring-django-cms-in-your-django-project>`_,
|
|
|
|
`cmsplugin-filer README <https://github.com/stefanfoulis/cmsplugin-filer#installation>`_
|
2015-03-02 06:17:02 +00:00
|
|
|
for detailed information.
|
2014-06-12 16:23:24 +00:00
|
|
|
|
2014-08-24 04:34:34 +00:00
|
|
|
* Configure parler according to your languages::
|
|
|
|
|
|
|
|
PARLER_LANGUAGES = {
|
|
|
|
1: (
|
|
|
|
{'code': 'en',},
|
|
|
|
{'code': 'it',},
|
|
|
|
{'code': 'fr',},
|
|
|
|
),
|
2016-01-25 21:55:12 +00:00
|
|
|
'default': {
|
|
|
|
'fallbacks': ['en', 'it', 'fr'],
|
|
|
|
}
|
2014-08-24 04:34:34 +00:00
|
|
|
}
|
|
|
|
|
2014-06-13 16:24:39 +00:00
|
|
|
* Add the following to your ``urls.py``::
|
2014-06-12 16:23:24 +00:00
|
|
|
|
2014-06-20 10:53:54 +00:00
|
|
|
url(r'^taggit_autosuggest/', include('taggit_autosuggest.urls')),
|
2014-06-12 16:23:24 +00:00
|
|
|
|
2015-10-01 06:15:37 +00:00
|
|
|
* To start your blog you need to use `AppHooks from django CMS <http://django-cms.readthedocs.org/en/support-3.0.x/how_to/apphooks.html>`_
|
2015-10-18 08:49:45 +00:00
|
|
|
to add the blog to a django CMS page; this step is not required when using
|
2015-10-31 01:19:16 +00:00
|
|
|
`Auto setup <auto_setup>`_:
|
2015-10-01 06:15:37 +00:00
|
|
|
|
2014-08-24 10:08:45 +00:00
|
|
|
* Create a new django CMS page
|
2016-02-10 20:56:28 +00:00
|
|
|
* Go to **Advanced settings** and select Blog from the **Application** selector and
|
|
|
|
create an **Application configuration**;
|
2014-08-24 10:08:45 +00:00
|
|
|
* Eventually customise the Application instance name;
|
2015-07-21 14:03:14 +00:00
|
|
|
* Publish the page
|
2014-08-24 10:08:45 +00:00
|
|
|
* Restart the project instance to properly load blog urls.
|
2014-08-11 21:45:10 +00:00
|
|
|
|
2016-02-10 20:56:28 +00:00
|
|
|
.. warning:: After adding the apphook to the page you **cannot** change the **Instance Namspace**
|
|
|
|
field for the defined **AppHokConfig**; if you want to change it, create a new one
|
|
|
|
with the correct namespace, go in the CMS page **Advanced settings** and switch to the
|
|
|
|
new **Application configuration**
|
|
|
|
|
2015-02-20 20:51:00 +00:00
|
|
|
* Add and edit blog by creating them in the admin or using the toolbar,
|
|
|
|
and the use the `django CMS frontend editor <http://django-cms.readthedocs.org/en/support-3.0.x/user/reference/page_admin.html#the-interface>`_
|
|
|
|
to edit the blog content:
|
2015-10-01 06:15:37 +00:00
|
|
|
|
2015-02-20 20:51:00 +00:00
|
|
|
* Create a new blog entry in django admin backend or from the toolbar
|
|
|
|
* Click on "view on site" button to view the post detail page
|
|
|
|
* Edit the post via djangocms frontend by adding / editing plugins
|
2015-10-18 08:49:45 +00:00
|
|
|
* Publish the blog post by flagging the "Publish" switch in the blog post
|
|
|
|
admin
|
2014-08-29 04:01:10 +00:00
|
|
|
|
2015-10-01 06:15:37 +00:00
|
|
|
Configurable permalinks
|
|
|
|
+++++++++++++++++++++++
|
|
|
|
|
|
|
|
Blog comes with four different styles of permalinks styles:
|
|
|
|
|
|
|
|
* Full date: ``YYYY/MM/DD/SLUG``
|
|
|
|
* Year / Month: ``YYYY/MM/SLUG``
|
|
|
|
* Category: ``CATEGORY/SLUG``
|
|
|
|
* Just slug: ``SLUG``
|
|
|
|
|
2015-10-18 08:49:45 +00:00
|
|
|
As all the styles are loaded in the urlconf, the latter two does not allow
|
|
|
|
to have CMS pages beneath the page the blog is attached to. If you want to
|
|
|
|
do this, you have to override the default urlconfs by setting something
|
|
|
|
like the following in the project settings::
|
2015-10-01 06:15:37 +00:00
|
|
|
|
2015-10-01 06:56:15 +00:00
|
|
|
BLOG_PERMALINK_URLS = {
|
2015-10-01 06:15:37 +00:00
|
|
|
'full_date': r'^(?P<year>\d{4})/(?P<month>\d{1,2})/(?P<day>\d{1,2})/(?P<slug>\w[-\w]*)/$',
|
|
|
|
'short_date': r'^(?P<year>\d{4})/(?P<month>\d{1,2})/(?P<slug>\w[-\w]*)/$',
|
|
|
|
'category': r'^post/(?P<category>\w[-\w]*)/(?P<slug>\w[-\w]*)/$',
|
|
|
|
'slug': r'^post/(?P<slug>\w[-\w]*)/$',
|
|
|
|
}
|
|
|
|
|
|
|
|
And change ``post/`` with the desired prefix.
|
|
|
|
|
2016-03-09 23:11:30 +00:00
|
|
|
Attaching blog to the home page
|
|
|
|
+++++++++++++++++++++++++++++++
|
|
|
|
|
|
|
|
If you want to attach the blog to the home page you have to adapt settings a bit otherwise the
|
|
|
|
"Just slug" permalink will swallow any CMS page you create.
|
|
|
|
|
|
|
|
To avoit this add the following settings to you project::
|
|
|
|
|
2016-06-29 14:23:01 +00:00
|
|
|
BLOG_AVAILABLE_PERMALINK_STYLES = (
|
2016-03-09 23:11:30 +00:00
|
|
|
('full_date', _('Full date')),
|
|
|
|
('short_date', _('Year / Month')),
|
|
|
|
('category', _('Category')),
|
|
|
|
)
|
2016-06-29 14:23:01 +00:00
|
|
|
BLOG_PERMALINK_URLS = {
|
2016-03-09 23:11:30 +00:00
|
|
|
'full_date': r'^(?P<year>\d{4})/(?P<month>\d{1,2})/(?P<day>\d{1,2})/(?P<slug>\w[-\w]*)/$',
|
|
|
|
'short_date': r'^(?P<year>\d{4})/(?P<month>\d{1,2})/(?P<slug>\w[-\w]*)/$',
|
|
|
|
'category': r'^(?P<category>\w[-\w]*)/(?P<slug>\w[-\w]*)/$',
|
|
|
|
}
|
|
|
|
|
|
|
|
Notice that the last permalink type is no longer present.
|
|
|
|
|
|
|
|
Then, pick any of the three remaining permalink types in the layout section of the apphooks config
|
|
|
|
linked ot the home page (see http://yoursite.com/admin/djangocms_blog/blogconfig/).'
|
|
|
|
|
2015-10-31 01:06:57 +00:00
|
|
|
Menu
|
|
|
|
++++
|
|
|
|
|
|
|
|
``djangocms_blog`` provides support for django CMS menu framework.
|
|
|
|
|
2016-02-04 03:53:40 +00:00
|
|
|
By default all the categories and posts are added to the menu, in a hierarchical structure.
|
2015-10-31 01:06:57 +00:00
|
|
|
|
2016-03-01 08:48:06 +00:00
|
|
|
It is possibile to configure per Apphook, whether the menu includes post and categories
|
|
|
|
(the default), only categories, only posts or no item.
|
2015-10-31 01:06:57 +00:00
|
|
|
|
2016-02-04 03:53:40 +00:00
|
|
|
If "post and categories" or "only categories" are set, all the posts not associated with a
|
|
|
|
category are not added to the menu.
|
|
|
|
|
2014-08-11 21:45:10 +00:00
|
|
|
Templates
|
|
|
|
+++++++++
|
|
|
|
|
2015-10-18 08:49:45 +00:00
|
|
|
To ease the template customisations a ``djangocms_blog/base.html`` template is
|
|
|
|
used by all the blog templates; the templates itself extends a ``base.html``
|
|
|
|
template; content is pulled in the ``content`` block.
|
|
|
|
If you need to define a different base template, or if your base template does
|
|
|
|
not defines a ``content`` block, copy in your template directory
|
|
|
|
``djangocms_blog/base.html`` and customise it according to your needs; the
|
|
|
|
other application templates will use the newly created base template and
|
|
|
|
will ignore the bundled one.
|
2014-01-05 09:34:10 +00:00
|
|
|
|
2015-10-18 08:49:45 +00:00
|
|
|
Templates set
|
|
|
|
+++++++++++++
|
2014-01-05 09:34:10 +00:00
|
|
|
|
2015-10-18 08:49:45 +00:00
|
|
|
By using **Apphook configuration** you can define a different templates set.
|
|
|
|
To use this feature provide a directory name in **Template prefix** field in
|
|
|
|
the **Apphook configuration** admin (in *Layout* section): it will be the
|
|
|
|
root of your custom templates set.
|
2014-04-26 07:01:23 +00:00
|
|
|
|
2015-10-31 01:19:16 +00:00
|
|
|
.. _auto_setup:
|
|
|
|
|
2015-10-18 08:49:45 +00:00
|
|
|
Auto setup
|
|
|
|
++++++++++
|
2014-04-27 02:24:31 +00:00
|
|
|
|
2015-10-18 08:49:45 +00:00
|
|
|
``djangocms_blog`` can install and configue itself if it does not find any
|
|
|
|
attached instance of itself.
|
|
|
|
This feature is enable by default and will create:
|
|
|
|
|
|
|
|
* a ``BlogConfig`` with default values
|
|
|
|
* a ``Blog`` CMS page and will attach ``djangocms_blog`` instance to it
|
2015-10-25 19:10:25 +00:00
|
|
|
* a **home page** if no home is found.
|
2015-10-18 08:49:45 +00:00
|
|
|
|
|
|
|
All the items will be created in every language configured for the website
|
|
|
|
and the pages will be published. If not using **aldryn-apphook-reload** or
|
|
|
|
**django CMS 3.2** auto-reload middleware you are required to reload the
|
|
|
|
project instance after this.
|
2015-10-18 09:03:47 +00:00
|
|
|
This will only work for the current website as detected by
|
|
|
|
``Site.objects.get_current()``.
|
2015-10-18 08:49:45 +00:00
|
|
|
|
|
|
|
|
|
|
|
The auto setup is execute once for each server start but it will skip any
|
|
|
|
action if a ``BlogConfig`` instance is found.
|
2014-04-27 02:24:31 +00:00
|
|
|
|
2014-04-26 07:01:23 +00:00
|
|
|
|
2015-10-31 01:06:57 +00:00
|
|
|
Sitemap
|
|
|
|
+++++++
|
|
|
|
|
|
|
|
``djangocms_blog`` provides a sitemap for improved SEO indexing.
|
|
|
|
Sitemap returns all the published posts in all the languages each post is available.
|
|
|
|
|
2015-10-31 01:19:16 +00:00
|
|
|
The changefreq and priority is configurable per-apphook (see ``BLOG_SITEMAP_*`` in
|
|
|
|
`Global settings <settings>`_).
|
2015-10-31 01:06:57 +00:00
|
|
|
|
|
|
|
To add the blog Sitemap, add the following code to the project ``urls.py``::
|
|
|
|
|
|
|
|
|
|
|
|
from cms.sitemaps import CMSSitemap
|
|
|
|
from djangocms_blog.sitemaps import BlogSitemap
|
|
|
|
|
|
|
|
|
|
|
|
urlpatterns = patterns(
|
|
|
|
'',
|
|
|
|
...
|
|
|
|
url(r'^sitemap\.xml$', 'django.contrib.sitemaps.views.sitemap',
|
|
|
|
{'sitemaps': {
|
|
|
|
'cmspages': CMSSitemap, 'blog': BlogSitemap,
|
|
|
|
}
|
|
|
|
}),
|
|
|
|
)
|
|
|
|
|
2016-05-11 15:22:12 +00:00
|
|
|
Multisite
|
|
|
|
+++++++++
|
|
|
|
|
|
|
|
django CMS blog provides full support for multisite setups.
|
|
|
|
|
|
|
|
Each blog post can be assigned to none, one or more sites: if no site is selected, then
|
|
|
|
it's visible on all sites.
|
|
|
|
|
|
|
|
This is matched with and API that allows to restrict users to only be able to edit
|
|
|
|
blog posts only for some sites.
|
|
|
|
|
|
|
|
To implement this API, you must add a ``get_sites`` method on the user model which
|
|
|
|
returns a queryset of sites the user is allowed to add posts to.
|
|
|
|
|
|
|
|
Example::
|
|
|
|
|
|
|
|
class CustomUser(AbstractUser):
|
|
|
|
sites = models.ManyToManyField('sites.Site')
|
|
|
|
|
|
|
|
def get_sites(self):
|
|
|
|
return self.sites
|
|
|
|
|
2015-10-31 01:06:57 +00:00
|
|
|
|
|
|
|
django CMS 3.2+ Wizard
|
|
|
|
++++++++++++++++++++++
|
|
|
|
|
|
|
|
django CMS 3.2+ provides a content creation wizard that allows to quickly created supported
|
|
|
|
content types, such as blog posts.
|
|
|
|
|
|
|
|
For each configured Apphook, a content type is added to the wizard.
|
|
|
|
|
2016-03-09 23:24:10 +00:00
|
|
|
Some issues with multiple registrations raising django CMS ``AlreadyRegisteredException``
|
|
|
|
hae been reported; to handle these cases gracefully, the exception is swallowed
|
|
|
|
when Django ``DEBUG == True`` avoiding breaking production websites. In these cases they
|
|
|
|
wizard may not show up, but the rest will work as intended.
|
2015-10-31 01:06:57 +00:00
|
|
|
|
2016-03-26 00:25:40 +00:00
|
|
|
django-knocker
|
|
|
|
++++++++++++++
|
|
|
|
|
|
|
|
``djangocms-blog`` is integrated with `django-knocker <https://github.com/nephila/django-knocker>`_
|
|
|
|
to provide real time desktop notifications.
|
|
|
|
|
|
|
|
See `django-knocker documentation <https://django-knocker.readthedocs.org/>`_ for how to configure
|
|
|
|
knocker.
|
|
|
|
|
2015-10-31 01:06:57 +00:00
|
|
|
.. _settings:
|
|
|
|
|
2016-09-10 19:46:43 +00:00
|
|
|
***************
|
2015-08-22 20:35:30 +00:00
|
|
|
Global Settings
|
2016-09-10 19:46:43 +00:00
|
|
|
***************
|
2015-10-18 08:49:45 +00:00
|
|
|
* BLOG_IMAGE_THUMBNAIL_SIZE: Size of the main image when shown on the post
|
|
|
|
lists; it's a dictionary with ``size``, ``crop`` and ``upscale`` keys;
|
2014-10-11 10:46:39 +00:00
|
|
|
(default: ``{'size': '120x120', 'crop': True,'upscale': False}``)
|
2015-10-18 08:49:45 +00:00
|
|
|
* BLOG_IMAGE_FULL_SIZE: Size of the main image when shown on the post
|
|
|
|
detail; it's a dictionary with ``size``, ``crop`` and ``upscale`` keys;
|
2014-10-11 10:46:39 +00:00
|
|
|
(default: ``{'size': '640x120', 'crop': True,'upscale': False}``)
|
2015-10-18 08:49:45 +00:00
|
|
|
* BLOG_PAGINATION: Number of post per page; (default: ``10``)
|
|
|
|
* BLOG_LATEST_POSTS: Default number of post in the **Latest post** plugin;
|
2015-10-29 20:47:13 +00:00
|
|
|
(default: ``5``)
|
2015-10-18 08:49:45 +00:00
|
|
|
* BLOG_POSTS_LIST_TRUNCWORDS_COUNT: Default number of words shown for
|
|
|
|
abstract in the post list; (default: ``100``)
|
|
|
|
* BLOG_TYPE: Generic type for the post object; (default: ``Article``)
|
|
|
|
* BLOG_TYPES: Choices of available blog types;
|
|
|
|
(default: to ``META_OBJECT_TYPES`` defined in `django-meta-mixin settings`_)
|
|
|
|
* BLOG_FB_TYPE: Open Graph type for the post object; (default: ``Article``)
|
|
|
|
* BLOG_FB_TYPES: Choices of available blog types;
|
|
|
|
(default: to ``META_FB_TYPES`` defined in `django-meta-mixin settings`_)
|
2014-04-26 07:01:23 +00:00
|
|
|
* BLOG_FB_APPID: Facebook Application ID
|
|
|
|
* BLOG_FB_PROFILE_ID: Facebook profile ID of the post author
|
|
|
|
* BLOG_FB_PUBLISHER: Facebook URL of the blog publisher
|
|
|
|
* BLOG_FB_AUTHOR_URL: Facebook profile URL of the post author
|
|
|
|
* BLOG_FB_AUTHOR: Facebook profile URL of the post author
|
2015-10-18 08:49:45 +00:00
|
|
|
* BLOG_TWITTER_TYPE: Twitter Card type for the post object;
|
|
|
|
(default: ``Summary``)
|
|
|
|
* BLOG_TWITTER_TYPES: Choices of available blog types for twitter;
|
|
|
|
(default: to ``META_TWITTER_TYPES`` defined in `django-meta-mixin settings`_)
|
2014-04-26 07:01:23 +00:00
|
|
|
* BLOG_TWITTER_SITE: Twitter account of the site
|
|
|
|
* BLOG_TWITTER_AUTHOR: Twitter account of the post author
|
2015-10-18 08:49:45 +00:00
|
|
|
* BLOG_GPLUS_TYPE: Google+ Snippet type for the post object;
|
|
|
|
(default: ``Blog``)
|
|
|
|
* BLOG_GPLUS_TYPES: Choices of available blog types for twitter;
|
|
|
|
(default: to ``META_GPLUS_TYPES`` defined in `django-meta-mixin settings`_)
|
2014-04-26 07:01:23 +00:00
|
|
|
* BLOG_GPLUS_AUTHOR: Google+ account of the post author
|
2015-08-22 20:35:30 +00:00
|
|
|
* BLOG_ENABLE_COMMENTS: Whether to enable comments by default on posts;
|
2015-10-18 08:49:45 +00:00
|
|
|
while ``djangocms_blog`` does not ship any comment system, this flag
|
|
|
|
can be used to control the chosen comments framework; (default: ``True``)
|
|
|
|
* BLOG_USE_ABSTRACT: Use an abstract field for the post; if ``False``
|
|
|
|
no abstract field is available for every post; (default: ``True``)
|
|
|
|
* BLOG_USE_PLACEHOLDER: Post content is managed via placeholder;
|
|
|
|
if ``False`` a simple HTMLField is used; (default: ``True``)
|
|
|
|
* BLOG_MULTISITE: Add support for multisite setup; (default: ``True``)
|
2015-08-22 20:35:30 +00:00
|
|
|
* BLOG_AUTHOR_DEFAULT: Use a default if not specified; if set to ``True`` the
|
|
|
|
current user is set as the default author, if set to ``False`` no default
|
|
|
|
author is set, if set to a string the user with the provided username is
|
2015-10-18 08:49:45 +00:00
|
|
|
used; (default: ``True``)
|
|
|
|
* BLOG_DEFAULT_PUBLISHED: If posts are marked as published by default;
|
|
|
|
(default: ``False``)
|
2015-12-14 12:46:55 +00:00
|
|
|
* BLOG_ADMIN_POST_FIELDSET_FILTER: Callable function to change(add or filter)
|
2015-12-15 10:13:32 +00:00
|
|
|
fields to fieldsets for admin post edit form; (default: ``False``). Function simple example::
|
2016-02-04 03:53:40 +00:00
|
|
|
|
|
|
|
|
2015-12-15 10:13:32 +00:00
|
|
|
def fieldset_filter_function(fsets, request, obj=None):
|
|
|
|
if request.user.groups.filter(name='Editor').exists():
|
|
|
|
fsets[1][1]['fields'][0].append('author') # adding 'author' field if user is Editor
|
|
|
|
return fsets
|
2016-02-04 03:53:40 +00:00
|
|
|
|
|
|
|
|
2015-08-22 20:35:30 +00:00
|
|
|
* BLOG_AVAILABLE_PERMALINK_STYLES: Choices of permalinks styles;
|
2015-10-18 08:49:45 +00:00
|
|
|
* BLOG_PERMALINK_URLS: URLConf corresponding to
|
|
|
|
BLOG_AVAILABLE_PERMALINK_STYLES;
|
2015-10-25 19:10:25 +00:00
|
|
|
* BLOG_DEFAULT_OBJECT_NAME: Default name for Blog item (used in django CMS Wizard);
|
2015-10-18 08:49:45 +00:00
|
|
|
* BLOG_AUTO_SETUP: Enable the blog **Auto setup** feature; (default: ``True``)
|
|
|
|
* BLOG_AUTO_HOME_TITLE: Title of the home page created by **Auto setup**;
|
|
|
|
(default: ``Home``)
|
|
|
|
* BLOG_AUTO_BLOG_TITLE: Title of the blog page created by **Auto setup**;
|
|
|
|
(default: ``Blog``)
|
|
|
|
* BLOG_AUTO_APP_TITLE: Title of the ``BlogConfig`` instance created by
|
|
|
|
**Auto setup**; (default: ``Blog``)
|
2015-10-31 00:26:06 +00:00
|
|
|
* BLOG_SITEMAP_PRIORITY_DEFAULT: Default priority for sitemap items; (default: ``0.5``)
|
|
|
|
* BLOG_SITEMAP_CHANGEFREQ: List for available changefreqs for sitemap items; (default: **always**,
|
|
|
|
**hourly**, **daily**, **weekly**, **monthly**, **yearly**, **never**)
|
|
|
|
* BLOG_SITEMAP_CHANGEFREQ_DEFAULT: Default changefreq for sitemap items; (default: ``monthly``)
|
2015-11-22 16:28:54 +00:00
|
|
|
* BLOG_CURRENT_POST_IDENTIFIER: Current post identifier in request (default ``djangocms_post_current``)
|
|
|
|
* BLOG_CURRENT_NAMESPACE: Current post config identifier in request (default: ``djangocms_post_current_config``)
|
|
|
|
* BLOG_ENABLE_THROUGH_TOOLBAR_MENU: Is the toolbar menu throught whole all applications (default: ``False``)
|
2015-11-27 22:26:04 +00:00
|
|
|
* BLOG_PLUGIN_MODULE_NAME: Blog plugin module name (default: ``Blog``)
|
|
|
|
* BLOG_LATEST_ENTRIES_PLUGIN_NAME: Blog latest entries plugin name (default: ``Latest Blog Articles``)
|
|
|
|
* BLOG_AUTHOR_POSTS_PLUGIN_NAME: Blog author posts plugin name (default: ``Author Blog Articles``)
|
|
|
|
* BLOG_TAGS_PLUGIN_NAME: Blog tags plugin name (default: ``Tags``)
|
|
|
|
* BLOG_CATEGORY_PLUGIN_NAME: Blog categories plugin name (default: ``Categories``)
|
|
|
|
* BLOG_ARCHIVE_PLUGIN_NAME: Blog archive plugin name (default: ``Archive``)
|
2016-04-30 09:04:26 +00:00
|
|
|
* BLOG_FEED_CACHE_TIMEOUT: Cache timeout for RSS feeds
|
|
|
|
* BLOG_FEED_INSTANT_ITEMS: Number of items in Instant Article feed
|
|
|
|
* BLOG_FEED_LATEST_ITEMS: Number of items in latest items feed
|
|
|
|
* BLOG_FEED_TAGS_ITEMS: Number of items in per tags feed
|
2015-08-22 20:35:30 +00:00
|
|
|
|
2015-10-31 01:06:57 +00:00
|
|
|
Read-only settings
|
|
|
|
++++++++++++++++++
|
|
|
|
|
|
|
|
* BLOG_MENU_TYPES: Available structures of the Blog menu; (default list **Posts and Categories**,
|
|
|
|
**Categories only**, **Posts only**, **None**)
|
|
|
|
* BLOG_MENU_TYPE: Structure of the Blog menu;
|
|
|
|
(default: ``Posts and Categories``)
|
|
|
|
|
|
|
|
|
2016-09-10 19:46:43 +00:00
|
|
|
********************
|
2015-08-22 20:35:30 +00:00
|
|
|
Per-Apphook settings
|
2016-09-10 19:46:43 +00:00
|
|
|
********************
|
2015-08-22 20:35:30 +00:00
|
|
|
|
2015-10-18 08:49:45 +00:00
|
|
|
* application title: Free text title that can be used as title in templates;
|
2015-10-25 19:10:25 +00:00
|
|
|
* object name: Free text label for Blog items in django CMS Wizard;
|
2015-10-18 08:49:45 +00:00
|
|
|
* Post published by default: Per-Apphook setting for BLOG_DEFAULT_PUBLISHED;
|
|
|
|
* Permalink structure: Per-Apphook setting for
|
|
|
|
BLOG_AVAILABLE_PERMALINK_STYLES;
|
|
|
|
* Use placeholder and plugins for article body: Per-Apphook setting for
|
|
|
|
BLOG_USE_PLACEHOLDER;
|
|
|
|
* Use abstract field: Per-Apphook setting for BLOG_USE_ABSTRACT;
|
|
|
|
* Set author: Per-Apphook setting for BLOG_AUTHOR_DEFAULT;
|
|
|
|
* Paginate sizePer-Apphook setting for BLOG_PAGINATION;
|
2015-08-22 20:35:30 +00:00
|
|
|
* Template prefix: Alternative directory to load the blog templates from;
|
2015-10-18 08:49:45 +00:00
|
|
|
* Menu structure: Per-Apphook setting for BLOG_MENU_TYPE
|
2015-10-31 00:26:06 +00:00
|
|
|
* Sitemap changefreq: Per-Apphook setting for BLOG_SITEMAP_CHANGEFREQ_DEFAULT
|
|
|
|
* Sitemap priority: Per-Apphook setting for BLOG_SITEMAP_PRIORITY_DEFAULT
|
2015-10-18 08:49:45 +00:00
|
|
|
* Object type: Per-Apphook setting for BLOG_TYPE
|
|
|
|
* Facebook type: Per-Apphook setting for BLOG_FB_TYPE
|
|
|
|
* Facebook application ID: Per-Apphook setting for BLOG_FB_APP_ID
|
|
|
|
* Facebook profile ID: Per-Apphook setting for BLOG_FB_PROFILE_ID
|
|
|
|
* Facebook page URL: Per-Apphook setting for BLOG_FB_PUBLISHER
|
|
|
|
* Facebook author URL: Per-Apphook setting for BLOG_AUTHOR_URL
|
|
|
|
* Facebook author: Per-Apphook setting for BLOG_AUTHOR
|
|
|
|
* Twitter type: Per-Apphook setting for BLOG_TWITTER_TYPE
|
|
|
|
* Twitter site handle: Per-Apphook setting for BLOG_TWITTER_SITE
|
|
|
|
* Twitter author handle: Per-Apphook setting for BLOG_TWITTER_AUTHOR
|
|
|
|
* Google+ type: Per-Apphook setting for BLOG_GPLUS_TYPE
|
|
|
|
* Google+ author name: Per-Apphook setting for BLOG_GPLUS_AUTHOR
|
2016-04-08 20:02:48 +00:00
|
|
|
* Send notifications on post publish: Send desktop notifications when a post is published
|
|
|
|
* Send notifications on post update: Send desktop notifications when a post is updated
|
2015-10-18 08:49:45 +00:00
|
|
|
|
|
|
|
|
|
|
|
Import from Wordpress
|
|
|
|
+++++++++++++++++++++
|
|
|
|
|
|
|
|
If you want to import content from existing wordpress blog, check
|
|
|
|
https://pypi.python.org/pypi/the-real-django-wordpress and
|
|
|
|
this gist https://gist.github.com/yakky/11336204 as a base.
|
2014-01-06 09:37:55 +00:00
|
|
|
|
2015-03-02 06:08:59 +00:00
|
|
|
Known djangocms-blog websites
|
|
|
|
+++++++++++++++++++++++++++++
|
|
|
|
|
2016-03-04 07:26:20 +00:00
|
|
|
See DjangoPackages for an updated list https://www.djangopackages.com/packages/p/djangocms-blog/
|
2015-10-18 08:49:45 +00:00
|
|
|
|
|
|
|
|
|
|
|
.. _django-meta-mixin settings: https://github.com/nephila/django-meta-mixin#settings
|