{"id":13774683,"url":"https://github.com/django-cms/djangocms-snippet","last_synced_at":"2025-12-17T13:06:40.763Z","repository":{"id":13811643,"uuid":"16507931","full_name":"django-cms/djangocms-snippet","owner":"django-cms","description":"django CMS Snippet provides a plugin for django CMS to inject HTML, CSS or JavaScript snippets into your website.","archived":false,"fork":false,"pushed_at":"2024-05-22T12:25:50.000Z","size":494,"stargazers_count":46,"open_issues_count":10,"forks_count":46,"subscribers_count":27,"default_branch":"master","last_synced_at":"2024-05-23T09:58:13.662Z","etag":null,"topics":["addon","cms","django","django-cms","python"],"latest_commit_sha":null,"homepage":"https://www.django-cms.org/en/repositories-plugins/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/django-cms.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG.rst","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-02-04T09:55:11.000Z","updated_at":"2024-06-18T18:14:04.972Z","dependencies_parsed_at":"2023-02-18T11:31:09.822Z","dependency_job_id":"84c907ae-4bde-4d60-8fb0-c5369190cc77","html_url":"https://github.com/django-cms/djangocms-snippet","commit_stats":{"total_commits":126,"total_committers":32,"mean_commits":3.9375,"dds":0.7142857142857143,"last_synced_commit":"b53f675c91dfeeab5c4a3fffd911fc3fa8a3841a"},"previous_names":["divio/djangocms-snippet"],"tags_count":23,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/django-cms%2Fdjangocms-snippet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/django-cms%2Fdjangocms-snippet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/django-cms%2Fdjangocms-snippet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/django-cms%2Fdjangocms-snippet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/django-cms","download_url":"https://codeload.github.com/django-cms/djangocms-snippet/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247557767,"owners_count":20958047,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["addon","cms","django","django-cms","python"],"created_at":"2024-08-03T17:01:29.286Z","updated_at":"2025-12-17T13:06:40.757Z","avatar_url":"https://github.com/django-cms.png","language":"Python","funding_links":[],"categories":["Add-ons"],"sub_categories":[],"readme":"==================\ndjango CMS Snippet\n==================\n\n|pypi| |coverage| |python| |django| |djangocms| |djangocms4|\n\n\n**django CMS Snippet** provides a plugin for `django CMS \u003chttp://django-cms.org\u003e`_\nto inject HTML, CSS or JavaScript snippets into your website.\n\nThis project is endorsed by the `django CMS Association \u003chttps://www.django-cms.org/en/about-us/\u003e`_. Join us on `Slack \u003chttps://www.django-cms.org/slack/\u003e`_.\n\n\n\nWarning: We recommend using this plugin only during development::\n\n    This plugin is a potential security hazard, since it allows authorized-\n    users to place custom markup or Javascript on pages bypassing all of\n    Django's normal sanitization mechanisms. This could be exploited by users\n    with the right to add snippets to elevate their privileges to superusers.\n    This plugin should only be used during the initial development phase for\n    rapid prototyping and testing.\n\n.. image:: preview.gif\n\n\n*******************************************\nContribute to this project and win rewards\n*******************************************\n\nBecause this is a an open-source project, we welcome everyone to\n`get involved in the project \u003chttps://www.django-cms.org/en/contribute/\u003e`_ and\n`receive a reward \u003chttps://www.django-cms.org/en/bounty-program/\u003e`_ for their contribution.\nBecome part of a fantastic community and help us make django CMS the best CMS in the world.\n\nWe'll be delighted to receive your\nfeedback in the form of issues and pull requests. Before submitting your\npull request, please review our `contribution guidelines\n\u003chttp://docs.django-cms.org/en/latest/contributing/index.html\u003e`_.\n\nWe're grateful to all contributors who have helped create and maintain this package.\nContributors are listed at the `contributors \u003chttps://github.com/django-cms/djangocms-snippet/graphs/contributors\u003e`_\nsection.\n\nOne of the easiest contributions you can make is helping to translate this addon on\n`Transifex \u003chttps://www.transifex.com/projects/p/djangocms-snippet/\u003e`_.\n\n\nDocumentation\n=============\n\nSee ``REQUIREMENTS`` in the `setup.py \u003chttps://github.com/divio/djangocms-snippet/blob/master/setup.py\u003e`_\nfile for additional dependencies.\n\n\nInstallation\n------------\n\nFor a manual install:\n\n* run ``pip install djangocms-snippet``\n* add ``djangocms_snippet`` to your ``INSTALLED_APPS``\n* run ``python manage.py migrate djangocms_snippet``\n\nDjangocms-snippet uses the ace code editor which normally is loaded from a CDN.\nIf you prefer your application to provide the editor locally, you can change\nthe requirement from `djangocms_snippet` to `djangocms_snippet[static-ace]` and\nadd `djangocms_static_ace` to your project's `INSTALLED_APPS`.\n\n\nConfiguration\n-------------\n\nTo allow the contents of all snippets to be searchable, please set\n``DJANGOCMS_SNIPPET_SEARCH`` to ``True`` in your settings::\n\n    DJANGOCMS_SNIPPET_SEARCH = True\n\nWe are using `Ace \u003chttps://ace.c9.io/#nav=about\u003e`_ as our editor of choice\nto edit the snippet content. You can customize the\n`theme \u003chttps://github.com/ajaxorg/ace/tree/master/lib/ace/theme\u003e`_ and\n`mode \u003chttps://github.com/ajaxorg/ace/tree/master/lib/ace/mode\u003e`_ through::\n\n    DJANGOCMS_SNIPPET_THEME = 'github'\n    DJANGOCMS_SNIPPET_MODE = 'html'\n\nIf dynamic content is inserted (for example ``{% show_menu ... %}``), the plugin cache must be disabled,\nplease set ``DJANGOCMS_SNIPPET_CACHE`` to ``False`` in your settings::\n\n    DJANGOCMS_SNIPPET_CACHE = False # default value is False\n\ndjango CMS 4 and later\n----------------------\n\nIf you use djangocms-versioning or djangocms-moderation, you can have snippets versioned and moderated by\nadding the following to your settings::\n\n    DJANGOCMS_SNIPPET_VERSIONING_ENABLED = True  # Set to version with djangocms-versioning\n    DJANGOCMS_SNIPPET_MODERATION_ENABLED = True  # Set to moderate with djangocms-moderation\n\nIf you enable versioning (e.g., set `DJANGOCMS_SNIPPET_VERSIONING = True`) for djangocms-snippets in a project that already contains snippets, you will need to create `Version` objects for those existing snippets using the `create_version` management command provided by djangocms-versioning.\n\nTemplate tag\n------------\n\nYou can also use a template tag to render a snippet rather than a plugin::\n\n    {% load snippet_tags %}\n    {% snippet_fragment [reference] %}\n\nReplace ``[reference]`` with either:\n\n* The snippet ID, e.g. ``{% snippet_fragment 42 %}``\n* The snippet slug, e.g. ``{% snippet_fragment 'my-snippet' %}``\n* The snippet instance, e.g. ``{% snippet_fragment instance.snippet %}``\n\nOptionally provide a fallback if there is no matching id/slug/instance::\n\n    {% snippet_fragment 'my-snippet' or %}\n        ... your content fallback here ...\n    {% endsnippet_fragment %}\n\n\nKnown Issues\n------------\n\nWhen adding a snippet with the `object` or `embed` tag as root element, the CMS toolbar crashes, making any further\nediting of the page difficult or impossible. A workaround is to just put those elements inside a `div` tag.\n\n\nRunning Tests\n-------------\n\nYou can run tests by executing::\n\n    virtualenv env\n    source env/bin/activate\n    pip install -r tests/requirements.txt\n    python setup.py test\n\n\n.. |pypi| image:: https://badge.fury.io/py/djangocms-snippet.svg\n    :target: http://badge.fury.io/py/djangocms-snippet\n.. |coverage| image:: https://codecov.io/gh/django-cms/djangocms-snippet/branch/master/graph/badge.svg\n    :target: https://codecov.io/gh/django-cms/djangocms-snippet\n.. |python| image:: https://img.shields.io/badge/python-3.9+-blue.svg\n    :target: https://pypi.org/project/djangocms-snippet/\n.. |django| image:: https://img.shields.io/badge/django-4.2+-blue.svg\n    :target: https://www.djangoproject.com/\n.. |djangocms| image:: https://img.shields.io/badge/django%20CMS-3.11-blue.svg\n    :target: https://www.django-cms.org/\n.. |djangocms4| image:: https://img.shields.io/badge/django%20CMS-4%2B-blue.svg\n    :target: https://www.django-cms.org/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdjango-cms%2Fdjangocms-snippet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdjango-cms%2Fdjangocms-snippet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdjango-cms%2Fdjangocms-snippet/lists"}