FlipperPA / django-md-cms

A markdown flat-file based CMS for Django
BSD 3-Clause "New" or "Revised" License
12 stars 1 forks source link

Django Markdown CMS (django-md-cms)

Django Markdown CMS: A markdown flat-file based CMS for Django.

Objectives:

Dependencies:

Installation:

Settings:

Settings example:

MD_CMS_ROOT = '/var/md_cms_content'
MD_CMS_DEFAULT_FILE = 'index.md'
MD_CMS_EDIT_SUFFIX = 'edit'

Example 1:

This example shows how to have django-md-cms control all the content for your site.

django-admin.py startproject myproject
pip install django-md-cms
cd myproject && python manage.py migrate
python manage.py createsuperuser

Then, edit your uls.py file, to look something like this:

from django.conf.urls import include, url
from django.contrib import admin
from md_cms.views import MdCMSView

urlpatterns = [
    url(r'^admin/', include(admin.site.urls)),
    url(r'^([A-Za-z0-9-/]*)/$', MdCMSView.as_view(), name='viewpage'),
    url(r'^([A-Za-z0-9-/]*)/' + settings.MD_CMS_EDIT_SUFFIX + '$', MdCMSEdit.as_view(), name='editpage'),
]

This set of patterns first looks for the Django Admin, then for any HTTP_INFO pattern matching any letter (upper or lowercase), a hyphen ('-'), or a foreward slash ('/'). These will result in the creation of valid system paths and files.

A Note About URLs: /this-page != /this_page/

Trailing slashes matter in your URLs! The way the logic is constructed is as follows:

Roadmap

0.2

0.3

0.4

0.5