Skip to main content

No project description provided

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

djangocms_git_md_page-2.0.1.tar.gz (21.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

djangocms_git_md_page-2.0.1-py3-none-any.whl (25.3 kB view details)

Uploaded Python 3

File details

Details for the file djangocms_git_md_page-2.0.1.tar.gz.

File metadata

  • Download URL: djangocms_git_md_page-2.0.1.tar.gz
  • Upload date:
  • Size: 21.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.3

File hashes

Hashes for djangocms_git_md_page-2.0.1.tar.gz
Algorithm Hash digest
SHA256 5d8e27f856840e462b0c8c6a573b2fb2a5a39bdad89b48f5f372ab7cdb5c4825
MD5 b5815245a5586a3969e175abcebf106a
BLAKE2b-256 17539ff0c319e8217870199cf4cc1f1dc67a67634421ec8af486a1d0dbeabb12

See more details on using hashes here.

File details

Details for the file djangocms_git_md_page-2.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for djangocms_git_md_page-2.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e6bf6248236c6a223805973cd836eaefedd1a4f0f0ed825958f61bfef9b5c792
MD5 5023a42ac1095ff31598fe3879ebdd21
BLAKE2b-256 34e659b3166bb6e2392e7075aae9faf945df27addbb4711db1ab54a1668e4777

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page