Skip to content

Instantly share code, notes, and snippets.

@hcosta
Last active March 31, 2023 17:22
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 5 You must be signed in to fork a gist
  • Save hcosta/15ae0835e5824685d46e75f49efc1bcb to your computer and use it in GitHub Desktop.
Save hcosta/15ae0835e5824685d46e75f49efc1bcb to your computer and use it in GitHub Desktop.
Código para conseguir ancho adaptativo en django-ckeditor

static/pages/css/custom_ckeditor.css

.django-ckeditor-widget, .cke_editor_id_content {
    width: 100% !important;
    max-width: 821px !important;
}

Inyectar en pages_menu.html

<link href="{% static 'pages/css/custom_ckeditor.css' %}" rel="stylesheet">

Inyectar en admin.py

from django.contrib import admin
from .models import Page

class PageAdmin(admin.ModelAdmin):
    list_display = ('title', 'order')
    
    # Inyectamos nuestro fichero css
    class Media:
        css = {
            'all': ('pages/css/custom_ckeditor.css',)
        }
        
admin.site.register(Page, PageAdmin)
@hcosta
Copy link
Author

hcosta commented Mar 22, 2018

Este es el código para conseguir ancho adaptativo en django-ckeditor en el curso de Django 2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment