iilab / contentascode

Content as Code
http://iilab.github.io/contentascode
GNU General Public License v3.0
34 stars 7 forks source link

Django Integration #14

Open jmatsushita opened 8 years ago

jmatsushita commented 8 years ago

Dealing with migration in and out of Django would probably start with a simple case, looking at a model with a single table being identified as content, published through a REST API with a JSON format and rendered/parsed to markdown.

On the Django side the framework could be http://www.django-rest-framework.org/ allowing to GET/PUT/POST JSON objects first and maybe implement later renderers and parsers for our Markdown Data enabled flavor.

Export

Export from Django would be done by making JSON objects (or arrays of JSON objects) available through an REST interface.

The creation of Markdown files would probably be using a similar approach of templated Markdown as here.

Block level metadata would be automatically constructed (using for instance JS dot notation by introspecting the template).

A JSON schema file would be produced to be used for both client/server side validation

Import

The Markdown would be parsed as JSON and validated with the JSON Schema on the client and/or through a integration/build script (Travis for instance) before being submitted to the REST API.

Todo

Related to #4