Page Builder

Page builder is a collection of widgets for the purpose of creating HTML pages.


Page builder depends on the following packages:

  • django-filer
  • markdown
  • bleach
  • sorl-thumbnail

You can install them manually, or you can install them using the django-widgy package:

$ pip install django-widgy[page_builder]


class widgy.contrib.page_builder.models.DefaultLayout


Who actually uses DefaultLayout?

class widgy.contrib.page_builder.models.MainContent
class widgy.contrib.page_builder.models.Sidebar
class widgy.contrib.page_builder.models.Markdown
class widgy.contrib.page_builder.models.Html

The HTML Widget provides a CKEditor field. It is useful for large blocks of text that need simple inline styling. It purposefully doesn’t have the capability to add images or tables, because there are already widgets that the developer can control.


There is a possible permission escalation vulnerability with allowing any admin user to add HTML. For this reason, the Html widget sanitizes all the HTML using bleach. If you want to add unsanitized HTML, please use the UnsafeHtml widget.

class widgy.contrib.page_builder.models.UnsafeHtml

This is a widget which allows the user to output arbitrary HTML. It is unsafe because a non-superuser could gain publishing the unsafe HTML on the website with XSS code to cause permission escalation.


The page_builder.add_unsafehtml and page_builder.edit_unsafehtml permissions are equivalent to is_superuser status because of the possibility of a staff user inserting JavaScript that a superuser will execute.

class widgy.contrib.page_builder.models.CalloutWidget
class widgy.contrib.page_builder.models.Accordion
class widgy.contrib.page_builder.models.Tabs
class widgy.contrib.page_builder.models.Section
class widgy.contrib.page_builder.models.Image
class widgy.contrib.page_builder.models.Video
class widgy.contrib.page_builder.models.Figure
class widgy.contrib.page_builder.models.GoogleMap
class widgy.contrib.page_builder.models.Button


class widgy.contrib.page_builder.models.Table
class widgy.contrib.page_builder.models.TableRow
class widgy.contrib.page_builder.models.TableHeaderData
class widgy.contrib.page_builder.models.TableData

Database Fields

class widgy.contrib.page_builder.db.fields.ImageField

A FilerFileField that only accepts images. Includes sensible defaults for use in Widgy — null=True, related_name='+' and on_delete=PROTECT.