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
|
|
|
|
2014-08-29 03:59:12 +00:00
|
|
|
|
2015-02-08 21:46:28 +00:00
|
|
|
.. image:: https://img.shields.io/pypi/v/djangocms-blog.svg
|
2014-08-29 04:01:10 +00:00
|
|
|
:target: https://pypi.python.org/pypi/djangocms-blog
|
|
|
|
:alt: Latest PyPI version
|
2015-02-08 21:46:28 +00:00
|
|
|
|
|
|
|
.. image:: https://img.shields.io/travis/nephila/djangocms-blog.svg
|
2014-08-29 04:01:10 +00:00
|
|
|
:target: https://travis-ci.org/nephila/djangocms-blog
|
|
|
|
:alt: Latest Travis CI build status
|
2014-06-11 11:05:41 +00:00
|
|
|
|
2015-02-08 21:46:28 +00:00
|
|
|
.. image:: https://img.shields.io/pypi/dm/djangocms-blog.svg
|
2014-06-11 19:34:56 +00:00
|
|
|
:target: https://pypi.python.org/pypi/djangocms-blog
|
2014-08-29 04:01:10 +00:00
|
|
|
:alt: Monthly downloads
|
2014-06-11 19:34:56 +00:00
|
|
|
|
2015-02-08 21:46:28 +00:00
|
|
|
.. image:: https://coveralls.io/repos/nephila/djangocms-blog/badge.png
|
|
|
|
:target: https://coveralls.io/r/nephila/djangocms-blog
|
2014-08-29 04:01:10 +00:00
|
|
|
:alt: Test coverage
|
2014-01-05 09:34:10 +00:00
|
|
|
|
|
|
|
|
2014-02-25 13:46:50 +00:00
|
|
|
A djangoCMS 3 blog application.
|
|
|
|
|
|
|
|
Still experimental and untested. You are welcome if you want to try it; if
|
|
|
|
you encounter any issue, please open an issue.
|
2014-01-05 09:34:10 +00:00
|
|
|
|
2014-06-11 11:01:39 +00:00
|
|
|
Supported Django versions:
|
|
|
|
|
|
|
|
* Django 1.5
|
|
|
|
* Django 1.6
|
2014-12-05 20:17:27 +00:00
|
|
|
* Django 1.7
|
2014-06-11 11:01:39 +00:00
|
|
|
|
|
|
|
Supported django CMS versions:
|
|
|
|
|
|
|
|
* django CMS 3.0
|
|
|
|
|
2014-11-30 11:58:10 +00:00
|
|
|
.. warning:: Starting from version 0.3 the length of the meta_description and
|
|
|
|
meta_title fields has been changed according to the most common
|
|
|
|
defaults for search engines. Existing data will not be affected,
|
|
|
|
but widgets that enforce the length for new data is now being used.
|
2014-01-05 09:34:10 +00:00
|
|
|
|
2014-12-05 14:52:37 +00:00
|
|
|
.. warning:: Starting from 0.3 BlogLatestEntriesPlugin and BlogAuthorPostsPlugin
|
|
|
|
the plugin API has changed: ``BlogLatestEntriesPlugin.get_posts``,
|
|
|
|
``BlogAuthorPostsPlugin.get_authors`` requires the ``request``
|
|
|
|
argument. Templates has been changed to use a context variable
|
|
|
|
instead. Please update your plugin templates accordingly.
|
|
|
|
|
2014-12-05 20:17:27 +00:00
|
|
|
.. warning:: To ease migration to version 0.3, djangocms-blog depends on south
|
|
|
|
even on Django 1.7; while this is unnecessary for Dajngo 1.7, it
|
|
|
|
makes transition to version 0.3 painless. Hard dependency will be
|
|
|
|
removed in 0.5.
|
|
|
|
|
2014-12-05 14:52:37 +00:00
|
|
|
|
2014-01-05 09:34:10 +00:00
|
|
|
Quickstart
|
|
|
|
----------
|
|
|
|
|
|
|
|
Install djangocms-blog::
|
|
|
|
|
2014-09-27 09:04:49 +00:00
|
|
|
pip install djangocms-blog
|
2014-01-05 09:34:10 +00:00
|
|
|
|
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',
|
|
|
|
'cmsplugin_filer_image',
|
2014-03-06 19:09:37 +00:00
|
|
|
'parler',
|
|
|
|
'taggit',
|
|
|
|
'taggit_autosuggest',
|
2014-08-19 17:28:09 +00:00
|
|
|
'django_select2',
|
2014-06-12 16:23:24 +00:00
|
|
|
'meta',
|
|
|
|
'meta_mixin',
|
2014-07-21 10:24:27 +00:00
|
|
|
'admin_enhancer',
|
2014-08-19 17:28:09 +00:00
|
|
|
'djangocms_blog',
|
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
|
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.
|
|
|
|
|
2014-06-13 16:24:39 +00:00
|
|
|
* Add the following settings to your project::
|
|
|
|
|
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-02-10 05:58:40 +00:00
|
|
|
|
|
|
|
* If you are using Django 1.7, be aware than ``filer``, ``cmsplugin_filer``
|
|
|
|
and ``django-cms`` currently requires you to setup ``MIGRATION_MODULES`` in settings::
|
|
|
|
|
|
|
|
MIGRATION_MODULES = {
|
|
|
|
'cms': 'cms.migrations_django',
|
|
|
|
'filer': 'filer.migrations_django',
|
|
|
|
'cmsplugin_filer_image': 'cmsplugin_filer_image.migrations_django',
|
|
|
|
}
|
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',},
|
|
|
|
),
|
|
|
|
}
|
|
|
|
|
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
|
|
|
|
2014-08-24 04:34:34 +00:00
|
|
|
* To start your blog create a new page from the CMS and hook it to the blog application:
|
2014-08-29 04:01:10 +00:00
|
|
|
|
2014-08-24 10:08:45 +00:00
|
|
|
* Create a new django CMS page
|
2015-02-08 05:21:03 +00:00
|
|
|
* Go to Advanced settings and select Blog from the Application selector;
|
2014-08-24 10:08:45 +00:00
|
|
|
* Eventually customise the Application instance name;
|
|
|
|
* Restart the project instance to properly load blog urls.
|
2014-08-11 21:45:10 +00:00
|
|
|
|
2014-08-29 04:01:10 +00:00
|
|
|
|
2014-08-11 21:45:10 +00:00
|
|
|
Templates
|
|
|
|
+++++++++
|
|
|
|
|
|
|
|
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 template and will ignore the bundled one.
|
2014-01-05 09:34:10 +00:00
|
|
|
|
|
|
|
Features
|
|
|
|
--------
|
|
|
|
|
2014-03-06 19:09:37 +00:00
|
|
|
* Placeholder content editing
|
|
|
|
* Frontend editing using django CMS 3.0 frontend editor
|
|
|
|
* Multilingual support using django-parler
|
2014-04-26 07:01:23 +00:00
|
|
|
* Support for Twitter cards, Open Graph and Google+ snippets meta tags
|
|
|
|
* Optional support for simpler TextField-based content editing
|
2014-10-04 17:27:53 +00:00
|
|
|
* Multisite support (posts can be visible in one or more Django sites on the same project)
|
2014-04-26 07:01:23 +00:00
|
|
|
|
2014-04-27 02:24:31 +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-04-26 07:01:23 +00:00
|
|
|
|
|
|
|
Settings
|
|
|
|
--------
|
|
|
|
* BLOG_ENABLE_COMMENTS: Whether to enable comments by default on posts;
|
2014-10-11 10:46:39 +00:00
|
|
|
while ``djangocms_blog`` does not ship any comment system, this flag can be used
|
2014-04-26 07:01:23 +00:00
|
|
|
to control the chosen comments framework; (default: True)
|
2014-10-11 10:46:39 +00:00
|
|
|
* BLOG_USE_PLACEHOLDER: Post content is managed via placeholder; if ``False`` a
|
2014-04-26 07:01:23 +00:00
|
|
|
simple HTMLField is used; (default: True)
|
|
|
|
* BLOG_IMAGE_THUMBNAIL_SIZE: Size of the main image when shown on the post lists;
|
2014-10-11 10:46:39 +00:00
|
|
|
it's a dictionary with ``size``, ``crop`` and ``upscale`` keys;
|
|
|
|
(default: ``{'size': '120x120', 'crop': True,'upscale': False}``)
|
2014-04-26 07:01:23 +00:00
|
|
|
* BLOG_IMAGE_FULL_SIZE: Size of the main image when shown on the post detail;
|
2014-10-11 10:46:39 +00:00
|
|
|
it's a dictionary with ``size``, ``crop`` and ``upscale`` keys;
|
|
|
|
(default: ``{'size': '640x120', 'crop': True,'upscale': False}``)
|
2014-10-04 17:27:53 +00:00
|
|
|
* BLOG_PAGINATION: Number of post per page; (default: 10)
|
|
|
|
* BLOG_LATEST_POSTS: Default number of post in the **Latest post** plugin; (default: 5)
|
2014-04-26 07:01:23 +00:00
|
|
|
* BLOG_POSTS_LIST_TRUNCWORDS_COUNT: Default number of words shown for abstract in the post list; (default: 100)
|
2014-10-04 17:27:53 +00:00
|
|
|
* BLOG_MULTISITE: Add support for multisite setup
|
2014-10-11 10:46:39 +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
|
|
|
|
used; (default: True)
|
2014-04-26 07:01:23 +00:00
|
|
|
|
|
|
|
Social media tags settings
|
|
|
|
++++++++++++++++++++++++++
|
|
|
|
* BLOG_TYPE: Generic type for the post object; (default: Article)
|
|
|
|
* BLOG_FB_TYPE: Open Graph type for the post object; (default: Article)
|
|
|
|
* 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
|
|
|
|
* BLOG_TWITTER_TYPE: Twitter Card type for the post object; (default: Summary)
|
|
|
|
* BLOG_TWITTER_SITE: Twitter account of the site
|
|
|
|
* BLOG_TWITTER_AUTHOR: Twitter account of the post author
|
|
|
|
* BLOG_GPLUS_TYPE: Google+ Snippet type for the post object; (default: Blog)
|
|
|
|
* BLOG_GPLUS_AUTHOR: Google+ account of the post author
|
2014-01-06 09:37:55 +00:00
|
|
|
|
|
|
|
.. image:: https://d2weczhvl823v0.cloudfront.net/nephila/djangocms-blog/trend.png
|
|
|
|
:alt: Bitdeli badge
|
|
|
|
:target: https://bitdeli.com/free
|
|
|
|
|