No project description provided
Project description
djangocms-git-md-page
DjangoCMS plugin for displaying a page with markdown in git repository.
Installation
- Add the
djangocms-git-md-plugin
into requirements and install it into the environment.
# setup.py
setup(
install_requires=[
# ...
'djangocms-git-md-page',
]
)
- Add
git_md_page
into theINSTALLED_APPS
# settings.py
INSTALLED_APPS = [
# ...
'git_md_page',
]
- Create an entry in
urls
for incoming notifications from GitHub.
# urls.py
urlpatterns = [
# ...
path('git_md_page/', include('git_md_page.urls')),
]
- 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file djangocms-git-md-page-2.0.0.tar.gz
.
File metadata
- Download URL: djangocms-git-md-page-2.0.0.tar.gz
- Upload date:
- Size: 23.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a9daaf302820a53402287ddb7bc93d3da72f108b1bd3814bb17b6d2658ee7086 |
|
MD5 | 63b366d58d0c40c6dfcb6b3a2dd0ad1d |
|
BLAKE2b-256 | 522a287c818a17dd6309915234acbae2375e9c4602a51fc48f2bef054bc11039 |
File details
Details for the file djangocms_git_md_page-2.0.0-py3-none-any.whl
.
File metadata
- Download URL: djangocms_git_md_page-2.0.0-py3-none-any.whl
- Upload date:
- Size: 28.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 845f64a471fe48a6d46e569c45bdbdb57b8ddd2a3cf0f4ae8e41de07592cdb4e |
|
MD5 | 7728c4ba5e152fb53fe5bfa682ea1095 |
|
BLAKE2b-256 | 30e87d5a18c2d68ade8a3326f94d4642652d8dc1212b66a5bed8d987ab1fc5e4 |