This is a rough demo of the techniques discussed in my DjangoCon US 2015 talk “Building theatlantic.com homepage’s WYSIWYG admin with Django and Knockout.”
To get started, clone the repo and run ./setup.sh
from the root directory, then activate the virtualenv and execute the following commands:
python apps/manage.py syncdb
python apps/manage.py runserver
Files of interest in this repository (all situated within the folder apps/curation_nouveau):
- static/curation_nouveau/js/homepage.js
- The file that iterates over the fields and builds and initializes the knockout models.
- static/curation_nouveau/js/homepage-models.js
- The knockout viewmodel classes
- templates/admin/curation_nouveau/homepagesection/change_form.html
- The django template containing the knockout template markup.