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).
existing stuff
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:
make a DB dump on the source system
insert the DB dump the the cloned system
log into django admin of the new cloned version
upload a “dummy.jpg” filer image
write down the filer image ID (e.g.: 123)
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
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 version |
python |
---|---|---|
>=v0.5.1 |
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 |
(See also combinations in .travis.yml and tox.ini)
TODO:
Add tests for ‘filer commands’
Support Django 1.9 and 1.10 and run tests against these versions.
history
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
NEW: DummyPageGenerator
NEW: ModelPermissionMixin
misc updates/changes
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
links
Homepage |
|
PyPi |
donation
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
File details
Details for the file django-cms-tools-0.5.1.tar.gz
.
File metadata
- Download URL: django-cms-tools-0.5.1.tar.gz
- Upload date:
- Size: 43.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f6e0562dca23b4021187c83df61559d1bf7f472e6603baabfda20b2bbcbfdc57 |
|
MD5 | 7a9349e9699f63025cf078c0c9d8d8c6 |
|
BLAKE2b-256 | a17fc3c41e76915c6c7daee6a735dc77492d981193b7e76d5858666c6f9a74b4 |
Provenance
File details
Details for the file django_cms_tools-0.5.1-py3.5.egg
.
File metadata
- Download URL: django_cms_tools-0.5.1-py3.5.egg
- Upload date:
- Size: 40.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d81649a4a75ea0402a772e3facceafaaa085e4fca47b44b250ef116fa7dcd367 |
|
MD5 | 325109cdb372323a644dd09658546cdc |
|
BLAKE2b-256 | f6e9ed3fd71acb952082efe8ce5efec7a9b431382fb2e7c9796bb22f44f0908d |
Provenance
File details
Details for the file django_cms_tools-0.5.1-py2.py3-none-any.whl
.
File metadata
- Download URL: django_cms_tools-0.5.1-py2.py3-none-any.whl
- Upload date:
- Size: 45.8 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 22e0414622f483763a19ba5184327987fa81696601212eb12ac260e278a87fda |
|
MD5 | e86488911dbb39e66774d68ec67d449f |
|
BLAKE2b-256 | a4190c580e89da13ecde0614402169c978fe840fc87b934f0895791dcbd9ba31 |