Summernote Django and Dash

pipinstallpython@gmail.com

F(hits) + Value(1)


Summernote is the best rich-text editor I've been able to find to date. Overall it offers more capabilities and customization than any other open sourced text editor I've been able to find. This feature packed library contains ways to style text, ability to change font, list, align content, create tables, embed links images and video and a code editor that can be used to embed code directly. 

Dash-Summernote - was created by me out of my love for both this text editor and a desire to create a working version of it within the Dash framework. After a few days of design and testing I was able to create a working package that I released to the public. With a simple pip install dash-summernote you can easily bring this package into any dash project and have access to use it in any Dash project.

Django-Summernote - was created in 2017 but was last maintained in 2021 which is concerning and problematic. The package allows "easy integration" into a django frontend and the admin portal and is what I've used and the main reason for creating this blog post. One note-able bug I ran into with recent development is a constant migrations issue #503 that would make it extremely difficult to build new models or collect static files. With this I set out on figuring out a work around so that I can continue using it within my Django projects which I'd like to share on how to setup to save those developers from the headache that has become the current branch of the project.

Do NOT pip install django-summernote. Save yourself the struggle and go directly to https://github.com/ethanhann/django-summernote what i did to set this up in working order was pip uninstall django-summernote (if django-summernote already installed) then in my requirements.txt file I added git+https://github.com/ethanhann/django-summernote.git@bug/0003_alter_attachment_id_does_not_exists also you can pip install git+https://github.com/ethanhann/django-summernote.git@bug/0003_alter_attachment_id_does_not_exists for good measure. If you are using a Docker file for your Django application I added git on setup in my Install apt packages with:

# Install apt packages
RUN apt-get update && apt-get install --no-install-recommends -y \
  # dependencies for building Python packages
  build-essential \
  # psycopg dependencies
  libpq-dev \
  # git for pip install
  git

With that you should be good! At this point you just need to make sure django_summernote.apps.DjangoSummernoteConfig is located within your DJANGO_APPS, set it up within your root urls path("summernote/", include("django_summernote.urls")) and you can start using it either form a forms.py routed into a view.py and template or from being directly declared in an admin.py file.