Add pages to a django site quickly with flatpages app and ckeditor
The full documentation is at TODO: https://django-pages.readthedocs.io.
Install the Django flatpages app
https://docs.djangoproject.com/en/1.11/ref/contrib/flatpages/
Install the django-ckeditor app
https://django-ckeditor.readthedocs.io/en/latest/index.html#installation
Install Django Pages:
pip install -e git+https://github.com/ronbeltran/django-pages@master#egg=django-pages
Add it to your `INSTALLED_APPS`:
INSTALLED_APPS = (
...
'django.contrib.flatpages',
'ckeditor',
'ckeditor_uploader',
'pages',
...
)
MIDDLEWARE = [
...
'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware',
...
]
Add Django Pages's URL patterns:
urlpatterns = [
...
url(r'^pages/', include('django.contrib.flatpages.urls')),
url(r'^ckeditor/', include('ckeditor_uploader.urls')),
...
]
Add in settings
CKEDITOR_UPLOAD_PATH = "uploads/"
CKEDITOR_IMAGE_BACKEND = "pillow"
For more details and customization with the ckeditor please see django-ckeditor
Make sure you have run the ff:
python manage.py migrate
python manage.py collectstatic --noinput
- TODO
Does the code actually work?
source <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install tox
(myenv) $ tox
Tools used in rendering this package: