django-pagelets¶
django-pagelets is a simple, flexible app for integrating static, unstructured content in a Django site.
For complete documentation, checkout http://django-pagelets.readthedocs.org
Features¶
- “Pagelets” for adding small pieces of content to otherwise static templates
- CMS “pages” which include any number of pagelets and, if needed, attachments
- Different pagelet content types including HTML and Markdown
- An integrated WYSIWYG editor (WYMeditor) which can be selectively enabled/disabled
Required Dependencies¶
- Django = 1.11
- A Python version supported by your chosen Django version
- Django admin site
- django-taggit 0.12.1 or greater
- django-selectable 0.9.0 or greater
- The django.template.context_processors.request context processor
Note: adding Django 2.0 support will require django-selectable to add Django 2.0 support first.
Optional Dependencies¶
- jQuery 1.7
- WYMeditor (included in pagelets media)
Installation and Setup¶
django-pagelets is available on PyPI, so the easiest way to install it is to use pip:
pip install django-pagelets
Add pagelets, selectable and taggit to INSTALLED_APPS in settings.py and run migrate:
INSTALLED_APPS = ( ..., 'pagelets', 'selectable', 'taggit' ... )
Make sure django.template.context_processors.request is loaded and that you have a template directory with a “base.html” template in it:
TEMPLATES=[ { ... 'DIRS': ['/home/user/projects/myproject/templates'], # <- should have 'base.html' inside ... 'OPTIONS': { 'context_processors': [ ... 'django.template.context_processors.request', ] }, }, ],
Add the pagelets URLs to urls.py, e.g.:
urlpatterns += [ url(r'^selectable/', include('selectable.urls')), url(r'^pagelets-management/', include('pagelets.urls.management')), url(r'^', include('pagelets.urls.content')), ]
Visit the admin site, add and save a new page, and click the View on site link. If everything is setup correctly, you should be able to see and edit the content you just added.
Development sponsored by Caktus Consulting Group, LLC..
Contents:
- Running the Sample Project
- Optional Additional Setup
- Built-in Template Tags
- List of Available Settngs
- Release History
- 1.1.0 (Released 2018-04-17)
- 1.0.0 (Released 2017-01-04)
- 0.10.0 (Released 2014-11-19)
- 0.9.1 (Released 2014-11-03)
- 0.9.0 (Released 2014-02-24)
- 0.8.0 (Released 2014-02-05)
- 0.7.2 (Released 2012-03-28)
- 0.7.1 (Released 2011-09-29)
- 0.7.0 (Released 2011-04-01)
- 0.6.2 (Released 2010-12-03)
- 0.6.0 (Released 2010-09-12)