Name | djangocms-git-md-page JSON |
Version | 2.0.0 JSON |
download | |
home_page | |
Summary | |
upload_time | 2023-10-10 10:30:11 |
maintainer | |
docs_url | None |
author | CZ.NIC, z.s.p.o. |
requires_python | |
license | |
keywords | |
VCS | |
bugtrack_url | |
requirements | No requirements were recorded. |
Travis-CI | No Travis. |
coveralls test coverage | No coveralls. |
# djangocms-git-md-page DjangoCMS plugin for displaying a page with markdown in git repository. ## Installation 1. Add the `djangocms-git-md-plugin` into requirements and install it into the environment. ```python # setup.py setup( install_requires=[ # ... 'djangocms-git-md-page', ] ) ``` 2. Add `git_md_page` into the `INSTALLED_APPS` ```python # settings.py INSTALLED_APPS = [ # ... 'git_md_page', ] ``` 3. Create an entry in `urls` for incoming notifications from GitHub. ```python # urls.py urlpatterns = [ # ... path('git_md_page/', include('git_md_page.urls')), ] ``` 4. Run migrations ```shell $ python manage.py migrate ``` ## Usage In the CMS administration, click the `+` symbol to add a new plugin. This plugin is named `Git MD page` and is located in the `Others` section. First of all, it is required to select the source repository. One can choose from the available choices or create a new choice (new source repository) by clicking the `+` symbol next to the select box. Every repository is defined by its address and branch. In the form, there are hints what value should be used. Also, there is another field called `secret`. Its default value is a random string which can be left for further usage. This `secret` value is then used for security purposes in the GitHub administration. When a repository is successfully selected, next fill the path to the desired MD file. After that, it is required to set up a _webhook_ in the GitHub project administration. It updates the content of the plugin every time the content of the file in the repository is changed. In your GitHub project administration, click `Settings` (horizontal navigation on the top of the page), `Webhooks` (left vertical navigation), `Add webhook` (a button in the right top corner). Note: If the item `Webhooks` is not in the vertical navigation, you probably do not have permissions to manage webhooks and you should ask the project owner to do it or for the permissions. In the form of a new webhook you set the `Payload URL` to `https://your.domain/git_md_page/endpoints/git_update/<repository-id>/`. The `your-domain` is the domain where the web page will be served, the `<repository-id>` will be explained later. Set the `ContentType` to `application/json` and finally set the `Secret` to the very same value as the `Secret` of the repository in your django-cms web application, as mentioned before (it should be the random string, by default). Last thing to mention is the `<repository-id>`. Getting this ID is a little confusing. In the django-cms web administration edit the repository instance and check the URL address. It should look like `https://your.domain/en/admin/git_md_page/gitrepository/1/change/?_to_field=id&_popup=1`. The part `gitrepository/1/` (alias `gitrepository/<repository-id>/`) is important, because it carries the repository identifier, `1`. This identifier is then used in the `Payload URL` when setting up the webhook, as mentioned before. For more information about the GitHub webhooks, check the [documentation](https://docs.github.com/en/developers/webhooks-and-events/webhooks).
{ "_id": null, "home_page": "", "name": "djangocms-git-md-page", "maintainer": "", "docs_url": null, "requires_python": "", "maintainer_email": "", "keywords": "", "author": "CZ.NIC, z.s.p.o.", "author_email": "kontakt@nic.cz", "download_url": "https://files.pythonhosted.org/packages/52/2a/287c818a17dd6309915234acbae2375e9c4602a51fc48f2bef054bc11039/djangocms-git-md-page-2.0.0.tar.gz", "platform": null, "description": "# djangocms-git-md-page\n\nDjangoCMS plugin for displaying a page with markdown in git repository.\n\n## Installation\n\n1. Add the `djangocms-git-md-plugin` into requirements and install it into the environment.\n\n```python\n# setup.py\nsetup(\n install_requires=[\n # ...\n 'djangocms-git-md-page',\n ]\n)\n```\n\n2. Add `git_md_page` into the `INSTALLED_APPS`\n\n```python\n# settings.py\nINSTALLED_APPS = [\n # ...\n 'git_md_page',\n]\n```\n\n3. Create an entry in `urls` for incoming notifications from GitHub.\n\n```python\n# urls.py\nurlpatterns = [\n # ...\n path('git_md_page/', include('git_md_page.urls')),\n]\n```\n\n4. Run migrations\n\n```shell\n$ python manage.py migrate\n```\n\n## Usage\n\nIn the CMS administration, click the `+` symbol to add a new plugin. This plugin is named `Git MD page` and is located\nin the `Others` section.\n\nFirst of all, it is required to select the source repository. One can choose from the available choices or create a new\nchoice (new source repository) by clicking the `+` symbol next to the select box. Every repository is defined by its\naddress and branch. In the form, there are hints what value should be used. Also, there is another field called\n`secret`. Its default value is a random string which can be left for further usage. This `secret` value is then used for\nsecurity purposes in the GitHub administration.\n\nWhen a repository is successfully selected, next fill the path to the desired MD file.\n\nAfter that, it is required to set up a _webhook_ in the GitHub project administration. It updates the content of\nthe plugin every time the content of the file in the repository is changed. In your GitHub project administration, click\n`Settings` (horizontal navigation on the top of the page), `Webhooks` (left vertical navigation), `Add webhook` (a\nbutton in the right top corner).\n\nNote: If the item `Webhooks` is not in the vertical navigation, you probably do not have permissions to manage webhooks\nand you should ask the project owner to do it or for the permissions.\n\nIn the form of a new webhook you set the `Payload URL` to\n`https://your.domain/git_md_page/endpoints/git_update/<repository-id>/`. The `your-domain` is the domain where the web\npage will be served, the `<repository-id>` will be explained later. Set the `ContentType` to `application/json` and\nfinally set the `Secret` to the very same value as the `Secret` of the repository in your django-cms web application, as\nmentioned before (it should be the random string, by default).\n\nLast thing to mention is the `<repository-id>`. Getting this ID is a little confusing. In the django-cms web\nadministration edit the repository instance and check the URL address. It should look like\n`https://your.domain/en/admin/git_md_page/gitrepository/1/change/?_to_field=id&_popup=1`. The part `gitrepository/1/`\n(alias `gitrepository/<repository-id>/`) is important, because it carries the repository identifier, `1`. This\nidentifier is then used in the `Payload URL` when setting up the webhook, as mentioned before.\n\nFor more information about the GitHub webhooks, check the\n[documentation](https://docs.github.com/en/developers/webhooks-and-events/webhooks).\n", "bugtrack_url": null, "license": "", "summary": "", "version": "2.0.0", "project_urls": null, "split_keywords": [], "urls": [ { "comment_text": "", "digests": { "blake2b_256": "30e87d5a18c2d68ade8a3326f94d4642652d8dc1212b66a5bed8d987ab1fc5e4", "md5": "7728c4ba5e152fb53fe5bfa682ea1095", "sha256": "845f64a471fe48a6d46e569c45bdbdb57b8ddd2a3cf0f4ae8e41de07592cdb4e" }, "downloads": -1, "filename": "djangocms_git_md_page-2.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "7728c4ba5e152fb53fe5bfa682ea1095", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 28882, "upload_time": "2023-10-10T10:30:10", "upload_time_iso_8601": "2023-10-10T10:30:10.196836Z", "url": "https://files.pythonhosted.org/packages/30/e8/7d5a18c2d68ade8a3326f94d4642652d8dc1212b66a5bed8d987ab1fc5e4/djangocms_git_md_page-2.0.0-py3-none-any.whl", "yanked": false, "yanked_reason": null }, { "comment_text": "", "digests": { "blake2b_256": "522a287c818a17dd6309915234acbae2375e9c4602a51fc48f2bef054bc11039", "md5": "63b366d58d0c40c6dfcb6b3a2dd0ad1d", "sha256": "a9daaf302820a53402287ddb7bc93d3da72f108b1bd3814bb17b6d2658ee7086" }, "downloads": -1, "filename": "djangocms-git-md-page-2.0.0.tar.gz", "has_sig": false, "md5_digest": "63b366d58d0c40c6dfcb6b3a2dd0ad1d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 23258, "upload_time": "2023-10-10T10:30:11", "upload_time_iso_8601": "2023-10-10T10:30:11.569341Z", "url": "https://files.pythonhosted.org/packages/52/2a/287c818a17dd6309915234acbae2375e9c4602a51fc48f2bef054bc11039/djangocms-git-md-page-2.0.0.tar.gz", "yanked": false, "yanked_reason": null } ], "upload_time": "2023-10-10 10:30:11", "github": false, "gitlab": false, "bitbucket": false, "codeberg": false, "lcname": "djangocms-git-md-page" }