Wysiwyg django. How to use django summernote in django flatpages?

 How to use django summernote in django flatpages? ( wysiwyg django )

I have already made the tables for flatpages. And I already created an app called “pages”.

Open the command prompt and run the following code:

pip install django-summernote


Add django summernote to your installed apps section in the “settings.py” file like this:



Next you should add django summernote url to the “urls.py” file like this:



Then set the MEDIA_URL for attachments in the “settings.py” file like this:



Import os if you haven’t done it already.



Now run the following pieces of code in the command prompt:

python manage.py migrate

python manage.py collectstatic


Then add the following piece of code in the “admin.py” file of the app called “pages” in order to register your models:



Go to http://127.0.0.1:8000/admin in the web browser, log in and you should see this:



Click on +add next to flatpages. You can see the html.editor.




Quill.js


Yet another editor that looks pretty good and apparently works well.


django-quill-editor makes Quill.js easy to use on Django Forms and admin sites. 

No configuration required for static files!

 
The entire code for inserting WYSIWYG editor is less than 30 lines
It can be used in both admin and Django views


https://github.com/LeeHanYeong/django-quill-editor/tree/master


Comments