How to use django summernote in django flatpages?

 How to use django summernote in django flatpages?

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.




Comments