Django project to add rich text editor django-ckeditor

django-ckeditor library using the steps:

  1. Install django-ckeditor this library the command line;

  命令:pip install django-ckeditor

  2. After a successful installation, configuration Django project settings.py file:

    2.1: The ckeditor and ckeditor_uploader registered to INSTALLED_APPS in:

    2.2: Configuration Editor storage path, and configuration ckeditor rich text below:

  

3. Rich Text Editor incorporated in the model (the models.py file), and used in the appropriate fields

  3.1: Introduction django-ckeditor rich text editor:

    from django.contrib.auth.models import AbstractUser

  3.2: Using the appropriate fields of the model:

    

4. The project re-run the migration, the migration file is generated under the manage.py file

   4.1 migration file is generated:

    python manage.py makemigrations

  4.2 to perform the migration:

    python manage.py migrate

5. Start Django project in the field and into the pages just to change the model, you can see a rich text editor to generate:

 

Description: This article is just my study notes for reference purposes only; before the Internet to find a lot of configuration rich text editor,

Finally found with Django framework ckeditor can quickly achieve a good rich text editor functions, and finally

Select the django-ckeditor library

 

Guess you like

Origin www.cnblogs.com/kaka6k66k/p/11279868.html
Recommended