{ "info": { "author": "Iacopo Spalletti", "author_email": "i.spalletti@nephila.it", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Framework :: Django", "Framework :: Django :: 1.10", "Framework :: Django :: 1.11", "Framework :: Django :: 1.8", "Framework :: Django :: 1.9", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Natural Language :: English", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6" ], "description": "=======================\ndjangocms-apphook-setup\n=======================\n\n|Gitter| |PyPiVersion| |PyVersion| |Status| |TestCoverage| |CodeClimate| |License|\n\nUtility function to auto setup apphooks on project startup.\n\nSupported Django versions:\n\n* Django 1.8 to 1.11\n\nSupported django CMS versions:\n\n* django CMS 3.4 to 3.5\n\nFeatures\n--------\n\nThe mixin included in this utility allows to automatically add an Apphook to a django CMS\nproject on the first access to the website.\n\nThis is intended for use by the django CMS application developers by extending their own\n``CMSApp`` classes.\n\nThis behavior simplify the initial setup of a project and lower the barrier for the end user.\n\nThe setup function included here does the following:\n\n* Check if the Apphook is already added to a CMS page\n* If it is, it skips any further step\n* If not:\n\n * Creates the home page (if not present)\n * Creates a sub page of the home\n * Adds the application Apphook to it\n\nIn case the application uses ``aldryn-apphooks-config``, a Apphook Config instance is created\nand added to the application page together with the Apphook.\n\n.. note:: To avoid issues with ``AldrynSearch`` during the creation of pages, the url of the\n pages is faked; this is normally not an issues as the pages will be reindexed\n whenever the content is updated.\n\nUsage\n-----\n\nThis utility can be used by extending the ``CMSApp`` class, adding the ``auto_setup`` attribute\nwith relevant configuration options and triggering setup at the end of ``cms_app.py``::\n\n\n @apphook_pool.register\n class App4(AutoCMSAppMixin, CMSConfigApp):\n name = _('App4')\n urls = ['sample_app_4.urls']\n app_name = 'app4'\n app_config = App4Config\n # djangocms-apphook-setup attribute\n auto_setup = {\n 'enabled': True,\n 'home title': 'home title',\n 'page title': 'page 4 title',\n 'namespace': 'namespace',\n 'config_fields': {'random_option': True},\n 'config_translated_fields': {'app_title': 'app title', 'object_name': 'name'},\n 'sites': True,\n }\n\n\n # trigger djangocms-apphook-setup function\n App4.setup()\n\n\nCustomizing ApphookConfig instances creation\n--------------------------------------------\n\nWhile ``config_fields`` and ``config_translated_fields`` should cover most use cases when it comes\nto ApphookConfig instances creation, you may need more control over the process.\n\nFor this, it's possible to override ``AutoCMSAppMixin._create_config`` and\n``AutoCMSAppMixin._create_config_translation``.\n\nDefault implementation::\n\n @classmethod\n def _create_config(cls):\n return cls.app_config.objects.create(\n namespace=cls.auto_setup['namespace'], **cls.auto_setup['config_fields']\n )\n\n @classmethod\n def _create_config_translation(cls, config, lang):\n config.set_current_language(lang, initialize=True)\n for field, data in cls.auto_setup['config_translated_fields'].items():\n setattr(config, field, data)\n config.save_translations()\n\n\nYou can completely redefine the methods, provided you return an ApphookConfig instance\nin ``_create_config``.\n\n\nConfiguration options\n---------------------\n\nThe behavior of the setup function can be customized by setting the following keys in the\n``auto_setup`` attribute:\n\n* ``enabled``: If ``True`` the setup is invoked; a good option is to use a setting to control this\n to allow application users to disable the behavior (default: ``True``)\n* ``home title``: Title of the home page if created by the setup function; this **must** be set in\n the application ``CMSApp``, otherwise the setup function will exit with a warning.\n* ``page title``: Title of the page created by the setup function; this **must** be set in\n the application ``CMSApp``, otherwise the setup function will exit with a warning.\n* ``namespace``: Application instance name used when attaching the Apphook; this **must** be set in\n the application ``CMSApp`` if an ``app_name`` is defined, otherwise the setup function will exit\n with a warning.\n* ``config_fields``: Fields used when creating the ApphookConfigModel instance; use this attribute\n for non-translated fields.\n* ``config_translated_fields``: Fields used when creating the ApphookConfigModel instance;\n use this attribute for translated fields (currently only ``django-parler`` is supported).\n* ``sites``: List of site ids for which to create the pages; if set to ``True`` (the default value)\n pages will be created for all sites. A single apphook config is created for all the sites;\n instance is created only on first page creation.\n\n\nNotes on testing\n----------------\n\nAs this utility works by triggering setup function at import time, extra steps must be taken\nin the tests to unload the modules between the tests (this is only needed when testing the setup).\n\nExample cleanup to be included in ``setUp`` method::\n\n def setUp(self):\n super(SetupAppBaseTest, self).setUp()\n from cms.apphook_pool import apphook_pool\n\n delete = [\n 'my_app',\n 'my_app.cms_app',\n ]\n for module in delete:\n if module in sys.modules:\n del sys.modules[module]\n MyApphoolConfigModel.cmsapp = None\n apphook_pool.clear()\n\n\n\n\n.. |Gitter| image:: https://img.shields.io/badge/GITTER-join%20chat-brightgreen.svg?style=flat-square\n :target: https://gitter.im/nephila/applications\n :alt: Join the Gitter chat\n\n.. |PyPiVersion| image:: https://img.shields.io/pypi/v/djangocms-apphook-setup.svg?style=flat-square\n :target: https://pypi.python.org/pypi/djangocms-apphook-setup\n :alt: Latest PyPI version\n\n.. |PyVersion| image:: https://img.shields.io/pypi/pyversions/djangocms-apphook-setup.svg?style=flat-square\n :target: https://pypi.python.org/pypi/djangocms-apphook-setup\n :alt: Python versions\n\n.. |Status| image:: https://img.shields.io/travis/nephila/djangocms-apphook-setup.svg?style=flat-square\n :target: https://travis-ci.org/nephila/djangocms-apphook-setup\n :alt: Latest Travis CI build status\n\n.. |TestCoverage| image:: https://img.shields.io/coveralls/nephila/djangocms-apphook-setup/master.svg?style=flat-square\n :target: https://coveralls.io/r/nephila/djangocms-apphook-setup?branch=master\n :alt: Test coverage\n\n.. |License| image:: https://img.shields.io/github/license/nephila/djangocms-apphook-setup.svg?style=flat-square\n :target: https://pypi.python.org/pypi/djangocms-apphook-setup/\n :alt: License\n\n.. |CodeClimate| image:: https://codeclimate.com/github/nephila/djangocms-apphook-setup/badges/gpa.svg?style=flat-square\n :target: https://codeclimate.com/github/nephila/djangocms-apphook-setup\n :alt: Code Climate\n\n\n\n\nHistory\n-------\n\n0.3.0 (2018-01-15)\n++++++++++++++++++\n\n* Add support for multisite setups\n* Add Django 1.11 support\n* Add django CMS 3.5 support\n\n0.2.0 (2016-12-04)\n++++++++++++++++++\n\n* Add support for multisite setups\n* Add Django 1.9, 1.10 support\n* Add django CMS 3.4 support\n\n0.1.2 (2015-12-22)\n++++++++++++++++++\n\n* Monekypatch aldryn_search index to avoid errors\n\n0.1.1 (2015-11-02)\n++++++++++++++++++\n\n* Easier extension of ApphookConfig creation\n\n0.1.0 (2015-10-24)\n++++++++++++++++++\n\n* First experimental release\n\n\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/nephila/djangocms-apphook-setup", "keywords": "djangocms-apphook-setup,django CMS,apphook", "license": "BSD", "maintainer": "", "maintainer_email": "", "name": "djangocms-apphook-setup", "package_url": "https://pypi.org/project/djangocms-apphook-setup/", "platform": "", "project_url": "https://pypi.org/project/djangocms-apphook-setup/", "project_urls": { "Homepage": "https://github.com/nephila/djangocms-apphook-setup" }, "release_url": "https://pypi.org/project/djangocms-apphook-setup/0.3.0/", "requires_dist": [ "django-cms" ], "requires_python": "", "summary": "Library to auto setup apphooks", "version": "0.3.0" }, "last_serial": 3489572, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "0b28a656111649d7dacccae41f3a98ad", "sha256": "36d163bc098d6e831403571174a5690af317d42a7d42a13eee5a52805bcaf1d2" }, "downloads": -1, "filename": "djangocms_apphook_setup-0.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "0b28a656111649d7dacccae41f3a98ad", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 8408, "upload_time": "2015-10-25T18:37:44", "url": "https://files.pythonhosted.org/packages/bc/ba/8147407f87119c602f174f5a1bacfdce29a3393a88253992fb74e61f776c/djangocms_apphook_setup-0.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "225a6d479599324abad4cee5f5a364d7", "sha256": "a35714c1a3c7cef48d6ab3fd7a5acb0bf8da59efcf02dbc257260e219f853d46" }, "downloads": -1, "filename": "djangocms-apphook-setup-0.1.0.tar.gz", "has_sig": false, "md5_digest": "225a6d479599324abad4cee5f5a364d7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7208, "upload_time": "2015-10-25T18:37:40", "url": "https://files.pythonhosted.org/packages/d1/12/1e231562d2ee0fb0571c6d1b25e0a06e318dfc326ac04b03adbc30e788ec/djangocms-apphook-setup-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "077f956fc2a5db5fa888991ef0b2d614", "sha256": "89c5e3398606d285a03571140c96dae7df3f6e8d2d6c306e6ad687631a83f561" }, "downloads": -1, "filename": "djangocms_apphook_setup-0.1.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "077f956fc2a5db5fa888991ef0b2d614", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 9524, "upload_time": "2015-11-02T22:25:25", "url": "https://files.pythonhosted.org/packages/bb/12/2e1b081c25782a1778794a00b76ab0c2f8a7ed142f03c79728c2bc2cca90/djangocms_apphook_setup-0.1.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "be0024673fb9af8270df3aca86d65cc3", "sha256": "8059aa1954f077bc58e0ba85b78a6b718cceaa1a99471025387c15836c9bd697" }, "downloads": -1, "filename": "djangocms-apphook-setup-0.1.1.tar.gz", "has_sig": false, "md5_digest": "be0024673fb9af8270df3aca86d65cc3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7927, "upload_time": "2015-11-02T22:25:15", "url": "https://files.pythonhosted.org/packages/4e/30/7f14153ed415fc265797f17a18b5f246b048d1932f1dc771337e8a5e00b7/djangocms-apphook-setup-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "56d51c5223847df4542ccd14aabf484d", "sha256": "20f6f2c3bad79ad106549a9d1e2d625026211cce59ea5dc68003295640c39849" }, "downloads": -1, "filename": "djangocms_apphook_setup-0.1.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "56d51c5223847df4542ccd14aabf484d", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 10075, "upload_time": "2015-12-22T05:02:32", "url": "https://files.pythonhosted.org/packages/06/a4/3e31a4aa41b9e3e7053983c2b68accfca2747ea179d8dac492c18a8c63bf/djangocms_apphook_setup-0.1.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "f10e75c9625df0516ea80ea7f9fe0a98", "sha256": "12a7e4b4e3e99deb61518e9a846693c4987bc858db09fd60319a363d27a5618f" }, "downloads": -1, "filename": "djangocms-apphook-setup-0.1.2.tar.gz", "has_sig": false, "md5_digest": "f10e75c9625df0516ea80ea7f9fe0a98", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8320, "upload_time": "2015-12-22T05:02:22", "url": "https://files.pythonhosted.org/packages/53/ff/7f2d79960a11fb1c6f98d04dd43ba1bc2bb256f4d5763b06ab48e67e745b/djangocms-apphook-setup-0.1.2.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "833a19e19503140f917c55b42b65b750", "sha256": "1251f38f8182ade181f334f65d3c54c420303b470617de2bddeb95da5a746cf0" }, "downloads": -1, "filename": "djangocms_apphook_setup-0.3.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "833a19e19503140f917c55b42b65b750", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 10840, "upload_time": "2018-01-14T22:21:50", "url": "https://files.pythonhosted.org/packages/3f/84/bccf4cf96645598672f395387269b4bba5463d4221a9a669f60f5f64d2b2/djangocms_apphook_setup-0.3.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "97dae56e40b12f9f918055acd3410726", "sha256": "c7177e5f79f3f8c05ed219ea5d7259746f56e86f2615bf4d234304fd2d973754" }, "downloads": -1, "filename": "djangocms-apphook-setup-0.3.0.tar.gz", "has_sig": false, "md5_digest": "97dae56e40b12f9f918055acd3410726", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8802, "upload_time": "2018-01-14T22:21:51", "url": "https://files.pythonhosted.org/packages/14/e3/783e7c827755c4d0373494dbd1b2fc5c7630affbbf96fe3aa59d560fe6da/djangocms-apphook-setup-0.3.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "833a19e19503140f917c55b42b65b750", "sha256": "1251f38f8182ade181f334f65d3c54c420303b470617de2bddeb95da5a746cf0" }, "downloads": -1, "filename": "djangocms_apphook_setup-0.3.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "833a19e19503140f917c55b42b65b750", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 10840, "upload_time": "2018-01-14T22:21:50", "url": "https://files.pythonhosted.org/packages/3f/84/bccf4cf96645598672f395387269b4bba5463d4221a9a669f60f5f64d2b2/djangocms_apphook_setup-0.3.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "97dae56e40b12f9f918055acd3410726", "sha256": "c7177e5f79f3f8c05ed219ea5d7259746f56e86f2615bf4d234304fd2d973754" }, "downloads": -1, "filename": "djangocms-apphook-setup-0.3.0.tar.gz", "has_sig": false, "md5_digest": "97dae56e40b12f9f918055acd3410726", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8802, "upload_time": "2018-01-14T22:21:51", "url": "https://files.pythonhosted.org/packages/14/e3/783e7c827755c4d0373494dbd1b2fc5c7630affbbf96fe3aa59d560fe6da/djangocms-apphook-setup-0.3.0.tar.gz" } ] }