Skip to main content

Tools/helpers around Django-CMS

Project description

Miscellaneous tools/helpers for django CMS.

Look also at the siblings project: django-tools (Tools/helpers around Django).

Build Status on travis-ci.org

travis-ci.org/jedie/django-cms-tools

Coverage Status on codecov.io

codecov.io/gh/jedie/django-tools

Coverage Status on coveralls.io

coveralls.io/r/jedie/django-cms-tools

Status on landscape.io

landscape.io/github/jedie/django-cms-tools/master

existing stuff

Django-CMS plugins

page anchor menu

Add a anchor menu to a CMS page. More info in: django_cms_tools/plugin_anchor_menu/README.creole

landing page

A app to create landing pages. More info in: django_cms_tools/plugin_landing_page/README.creole

test fixture creation

django_cms_tools.fixtures.pages

Helper for creating Django CMS pages in test fixtures:

Class django_cms_tools.fixtures.pages.***CmsPageCreator* can be used for create normal/plugin CMS pages. Inherit from the class and overwrite attributes/methods for your need ;) Example, look into the Test code.

Source: django_cms_tools/fixtures/pages.py Test/Example: /tests/test_fixtures_pages.py

create_cms_index_pages

Create CMS home page in all existing languages (settings.LANGUAGES) and fill placeholder with TextPlugin, use:

  • django_cms_tools.fixtures.pages.***create_cms_index_pages*

create_cms_plugin_page

Create CMS plugin page in all existing languages (settings.LANGUAGES) and add a link to the index page.

  • django_cms_tools.fixtures.pages.***create_cms_plugin_page*

django filer tools experimental

Activate by change your settings.py, e.g.:

INSTALLED_APPS = [
    ...
    'django_cms_tools.filer_tools',
    ...
]

‘image info’ management command

Display information about the number of existing, missing and ignored images. And a summary about all used images. usage:

$ ./manage.py image_info

34 items - foo.Bar
34 instanced checked:
   0 exist    0 missing   34 ignored - foo.BarModel.meta_image
  34 exist    0 missing    0 ignored - foo.BarModel.filer_overview_image

...

total:
    existing images..: 6171
    missing images...: 0
-------------------------------------------------------------------------------
Collect all filer IDs...
File: 2 entries
Image: 2 entries
Information about File:
    Total entry count: 8042 entries.
    Used entry count: 2 entries.
    Total size: 13.8 GB
    Used size: 997.5 KB
Information about Image:
    Total entry count: 6993 entries.
    Used entry count: 2 entries.
    Total size: 13.7 GB
    Used size: 997.5 KB
(Note: 'File' contains 'Image' ;)

‘replace broken’ management command

Replace all not existing files files with a given filer ID.

e.g.: You would like to make a clone of a existing installation, but without to move the real files:

  1. make a DB dump on the source system

  2. insert the DB dump the the cloned system

  3. log into django admin of the new cloned version

  4. upload a “dummy.jpg” filer image

  5. write down the filer image ID (e.g.: 123)

  6. start: $ ./manage.py replace_broken 123

‘template_info’ management command

Activate e.g.:

INSTALLED_APPS = [
    ...
    'django_cms_tools',
    ...
]

It looks like:

$ ./manage.py template_info

There are 3 public pages:
pk:1 /en/                                     /foo/homepage.html
pk:2 /en/foo/                                 INHERIT
pk:3 /en/foo/bar/                             INHERIT

‘cms_plugin_info’ management command

Activate e.g.:

INSTALLED_APPS = [
    ...
    'django_cms_tools',
    ...
]

It looks like:

$ ./manage.py cms_plugin_info

There are 4 CMS plugins:
'Django CMS Tools Test'
    * RelatedPlugin (Related Plugin)
'Generic'
    * PlaceholderPlugin (Placeholder)
    * AliasPlugin (Alias)
    * TextPlugin (Text)

run test project

.../django-cms-tools$ ./run_test_project_dev_server.sh

or:

.../django-cms-tools$ cd django_cms_tools_test_project/
.../django-cms-tools/django_cms_tools_test_project$ ./manage.py run_test_project_dev_server

running tests

Run all tests in all environment combinations via tox:

$ python3 setup.py tox

Run all tests in current environment via pytest:

$ python3 setup.py test

Django compatibility

django-cms-tools

Django CMS

django version

python

>=v0.6

3.4.x

v1.11

3.5, 3.6, pypy3

>=v0.5.1

3.4.x

1.8, v1.11

3.5, 3.6, pypy3

v0.4.0

1.8

2.7, 3.5, 3.6

v0.1.x

1.8

2.7, 3.4, 3.5

Currently Django CMS v3.5 is not supported, yet. It’s on the TODO, see: issues #1 (See also combinations in .travis.yml and tox.ini)

TODO:

  • Add tests for ‘filer commands’

  • Support Django CMS v3.5 and run tests against these versions.

  • Support Django v2.0 and run tests against these versions.

history

  • dev - compare v0.6.5…master

  • v0.6.5 - 22.03.2018 - compare v0.6.4…v0.6.5

    • Use ParlerDummyGenerator (for landing page test fixtures) from django-tools

    • django_cms_tools.fixtures.languages.iter_languages was moved to django-tools!

    • Bugfix: DummyPageGenerator creates non-published pages

  • v0.6.4 - 06.03.2018 - compare v0.6.3…v0.6.4

    • Update django_cms_tools.fixtures.pages.DummyPageGenerator to changes API

  • v0.6.3 - 23.02.2018 - compare v0.6.2…v0.6.3

    • Rename landing page and anchor menu plugins via django.apps.AppConfig

    • Update publisher itegration tests

  • v0.6.2 - 22.02.2018 - compare v0.6.1…v0.6.2

    • Bugfix packaging: Include template files

  • v0.6.1 - 22.02.2018 - compare v0.6.0…v0.6.1

    • Update “landing page” plugin to new publisher API

  • v0.6.0 - 20.02.2018 - compare v0.5.2…v0.6.0

    • remove test runs with Django v1.8

    • NEW: Django-CMS plugin for create “landing pages”

    • NEW: Django-CMS plugin for build a page anchor menu

    • NEW: ./manage.py cms_plugin_info to generate a list of all registered Django CMS plugins

  • v0.5.2 - 10.01.2018 - compare v0.5.1…v0.5.2

    • enhance and bugfix ‘replace_broken’ command

  • v0.5.1 - 21.12.2017 - compare v0.5.0…v0.5.1

    • refactor travis/tox/pytest/coverage stuff

    • Tests can be run via python3 setup.py tox and/or python3 setup.py test

    • Test also with pypy3 on Travis CI.

  • v0.5.0 - 19.12.2017 - compare v0.4.0…v0.5.0

    • Skip official support for python v2 (remove from text matrix)

    • NEW: ./manage.py template_info

    • NEW: ./manage.py cms_page_info

    • CmsPageCreator API changed:

      • the string CmsPageCreator.placeholder_slot changed to iterable CmsPageCreator.placeholder_slots

      • add placeholder argument in CmsPageCreator.get_dummy_text() and CmsPageCreator.get_add_plugin_kwargs()

      • Bugfix: use always drafts as parent pages (see also: https://github.com/divio/django-cms/pull/6126 )

      • add unittests

  • v0.4.0 - 18.09.2017 - compare v0.3.2…v0.4.0

  • v0.3.2 - 22.05.2017 - compare v0.3.1…v0.3.2

    • Bugfix in {% el_pagination_placeholder %} and render all plugins after the tag.

  • v0.3.1 - 04.05.2017 - compare v0.3.0…v0.3.1

    • Bugfix in CmsPageCreator: evaluate lazy “language name” translation in the right language (e.g.: e.g.: settings.LANGUAGE_CODE is not “en”)

  • v0.3.0 - 27.04.2017 - compare v0.2.0…v0.3.0

    • NEW: django_cms_tools.fixtures.pages.***CmsPageCreator* for creating Django CMS pages in test fixtures

  • v0.2.0 - 10.04.2017 - compare v0.1.2…v0.2.0

    • Experimental: Filer management commands: ‘image_info’ and ‘replace_broken’

  • v0.1.2 - 28.03.2017 - compare v0.1.1…v0.1.2

    • Change: create pages with translated language name

  • v0.1.1 - 27.03.2017 - compare v0.1.0…v0.1.1

    • Fix pypi package stuff

  • v0.1.0 - 27.03.2017

    • NEW: create_cms_index_pages

    • NEW: create_cms_plugin_page

donation

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-cms-tools-0.6.5.tar.gz (60.4 kB view details)

Uploaded Source

Built Distributions

django_cms_tools-0.6.5-py3.6.egg (68.7 kB view details)

Uploaded Source

django_cms_tools-0.6.5-py2.py3-none-any.whl (76.2 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file django-cms-tools-0.6.5.tar.gz.

File metadata

File hashes

Hashes for django-cms-tools-0.6.5.tar.gz
Algorithm Hash digest
SHA256 54d3a96e608825bd6ac98bb286fee309b73612c7d7761462a17f119afb10fc66
MD5 71b1c56ab4cb001d123bab9b49498945
BLAKE2b-256 223d846e4eb798c7f69108ab09b79b04ad8cd99b8d60dca15c5a252b845b475f

See more details on using hashes here.

Provenance

File details

Details for the file django_cms_tools-0.6.5-py3.6.egg.

File metadata

File hashes

Hashes for django_cms_tools-0.6.5-py3.6.egg
Algorithm Hash digest
SHA256 0fc8e7deb3afa19435daa4912813fc36096044af567778c0bb297ec62cdde355
MD5 def9ba05ca0a021b1a4e258d21b0ce2c
BLAKE2b-256 f60b08c45d8b2b6e244ff0cdc3b53d96f82b7063b387ed49ca12c93f282df67c

See more details on using hashes here.

Provenance

File details

Details for the file django_cms_tools-0.6.5-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for django_cms_tools-0.6.5-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 961ed1c8a5dea69f5414b50ea76056141f388da7205d183b0883c4547f0492d2
MD5 99fdfd5491b5fec317ac947b3b11c41c
BLAKE2b-256 b2232080123581160e0fbae6d9005d2571fb5c6c345dcd9c3ccdf6d350887fe2

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page