Skip to main content

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.
# setup.py
setup(
    install_requires=[
        # ...
        'djangocms-git-md-page',
    ]
)
  1. Add git_md_page into the INSTALLED_APPS
# settings.py
INSTALLED_APPS = [
    # ...
    'git_md_page',
]
  1. Create an entry in urls for incoming notifications from GitHub.
# urls.py
urlpatterns = [
    # ...
    path('git_md_page/', include('git_md_page.urls')),
]
  1. Run migrations
$ 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.

Metadata

Release files for djangocms-git-md-page 2.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for djangocms-git-md-page 2.0.1
File Size Uploaded
djangocms_git_md_page-2.0.1.tar.gz 21.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for djangocms-git-md-page 2.0.1
File Interpreter ABI Platform
djangocms_git_md_page-2.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 46.4 kB

Release files / djangocms_git_md_page-2.0.1.tar.gz

Download URL djangocms_git_md_page-2.0.1.tar.gz
Size 21.1 kB
Tags Source
SHA-256 checksum
How to use checksums
5d8e27f856840e462b0c8c6a573b2fb2a5a39bdad89b48f5f372ab7cdb5c4825
BLAKE2b-256 checksum
How to use checksums
17539ff0c319e8217870199cf4cc1f1dc67a67634421ec8af486a1d0dbeabb12
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.12.3

Release files / djangocms_git_md_page-2.0.1-py3-none-any.whl

Download URL djangocms_git_md_page-2.0.1-py3-none-any.whl
Size 25.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e6bf6248236c6a223805973cd836eaefedd1a4f0f0ed825958f61bfef9b5c792
BLAKE2b-256 checksum
How to use checksums
34e659b3166bb6e2392e7075aae9faf945df27addbb4711db1ab54a1668e4777
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.12.3

Release history Release notifications | RSS feed

This release

2.0.1 This release

2 release files

2.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page