Giter Club home page Giter Club logo

django-ckeditor-filebrowser-filer's Introduction

django-ckeditor-filebrowser-filer

Join the Gitter chat Latest PyPI version Python versions License

A django-filer based CKEditor filebrowser

Supported versions

Python: 3.7 to 3.11

Django: 3.2 to 4.2

django-filer: 2.0 and above

Documentation

Original code is taken from django-ckeditor-filer

It supports both ckeditor widget provided by django-ckeditor and the one provided by djangocms-text-ckeditor.

Warning

if you are using filer<1.2 this plugin requires django CMS cmsplugin_filer_image, thus you need to install and configure both according to their respective documentation.

Quickstart

  • Install django-ckeditor-filebrowser-filer:

    pip install django-ckeditor-filebrowser-filer
    
  • Add it to INSTALLED_APPS along with its dependencies:

    'filer',
    'ckeditor_filebrowser_filer',
    
  • Configure django-filer Canonical URLs

  • Add ckeditor_filebrowser_filer to urlconf:

    url(r'^filebrowser_filer/', include('ckeditor_filebrowser_filer.urls')),
    

    Currently only filebrowser_filer/ is supported as url path

  • Add FilerImage button to you CKEditor configuration:

    • Add 'FilerImage' to a toolbar in CKEDITOR_CONFIGS
    • Add 'filerimage' in `` 'extraPlugins'`` in CKEDITOR_CONFIGS
    • Add 'image' in `` 'removePlugins'`` in CKEDITOR_CONFIGS

Example:

CKEDITOR_CONFIGS = {
    'default': {
        'toolbar': 'Custom',
        'toolbar_Custom': [
            ...
            ['FilerImage']
        ],
        'extraPlugins': 'filerimage',
        'removePlugins': 'image'
    },
}

when using djangocms-text-ckeditor use CKEDITOR_SETTINGS instead of CKEDITOR_CONFIGS.

django-ckeditor-filebrowser-filer's People

Contributors

aleray avatar astagi avatar azraelless avatar bee-keeper avatar fgmacedo avatar gasimgasimzada avatar mateuspadua avatar pre-commit-ci[bot] avatar protoroto avatar radiac avatar yakky avatar yihuang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

django-ckeditor-filebrowser-filer's Issues

Django-suit

I'm trying to get a filer integration on my CKEditor, but our CMS is based on Django-Suit, not Django-CMS.

I found some issues:

It looks like Django CMS is still pulled down (for a filer button?), and then when I run my app it crashes because Django CMS checks for django-mptt and fails, even though django-mptt is a root dependency (for some other packages).

django.core.exceptions.ImproperlyConfigured: django CMS requires django-mptt package.

So my main question: has this ever been run without Django-CMS?

Bad URL generated in the Image picker popup

The image picker, after choosing the image from the filer media library, generates a bad url in the form of 0<!-- fn5oKSUxu1GBDpdmY1wB -->4/ and the image is not displayed nor added to the HTMLField content.
schermata 2017-07-22 alle 15 16 38
schermata 2017-07-22 alle 15 16 23

As a temporary, yet very uncomfortable, workaround it's possible to look into the image properties, copy the canonical_url, and paste it in place of the wrong generated url.

I wonder if I'm missing some important info here...

I believe everything is correctly setup:
settings.py

FILER_CANONICAL_URL = 'sharing/'
CKEDITOR_SETTINGS = {
    'skin': 'moono',
    'toolbar_HTMLField': [
        ['Bold', 'Italic', 'Underline', 'Blockquote', '-', 'Subscript', 'Superscript', '-', 'RemoveFormat'],
        ['Undo', 'Redo'],
        ['ShowBlocks'],
        ['Format', 'Styles'],
        ['FilerImage', 'HorizontalRule', 'Table']
    ],
    'extraPlugins': 'filerimage',
    'removePlugins': 'image'
}

urls.py

urlpatterns = [
    url(r'^filer/', include('filer.urls')),
    url(r'^filebrowser_filer/', include('ckeditor_filebrowser_filer.urls')),
]

Any clue?

Add FilerImage button

"Add FilerImage button to you CKEditor configuration."

How do I do this? Every time I try, it breaks ckeditor to where it doesn't load in the cms page.

I've tried adding 'filerimage', to the extraPlugins list, and then adding 'Filer Image' to the toolbar, but that breaks as well. Can't get this working.

Support for alt tags

It would be useful for Alt attribute to be pulled from the image in Filer, and the same for Caption, at the moment Alt is not supported, and Caption needs to be added manually, despite the caption existing in Filer

RuntimeError: Model class menus.models.CacheKey doesn't declare an explicit app_label and isn't in an application in INSTALLED_APPS.

Hi there,

I have followed the install instructions with the deps below. I get the error list in the title.

Django==1.9.7
django-filer==1.2.0
django-ckeditor==5.0.3
django-ckeditor-filebrowser-filer==0.1.1.post1
File "/vagrant/app/my-project/urls.py", line 53, in <module>
    url(r'^filebrowser_filer/', include('ckeditor_filebrowser_filer.urls')),
  File "/home/vagrant/my-project/local/lib/python2.7/site-packages/django/conf/urls/__init__.py", line 52, in include
    urlconf_module = import_module(urlconf_module)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/home/vagrant/my-project/local/lib/python2.7/site-packages/ckeditor_filebrowser_filer/urls.py", line 3, in <module>
    from .views import  *
  File "/home/vagrant/my-project/local/lib/python2.7/site-packages/ckeditor_filebrowser_filer/views.py", line 7, in <module>
    from cmsplugin_filer_image.models import ThumbnailOption
  File "/home/vagrant/my-project/local/lib/python2.7/site-packages/cmsplugin_filer_image/models.py", line 12, in <module>
    from cms.models import CMSPlugin
  File "/home/vagrant/my-project/local/lib/python2.7/site-packages/cms/models/__init__.py", line 3, in <module>
    from .pagemodel import *  # nopyflakes
  File "/home/vagrant/my-project/local/lib/python2.7/site-packages/cms/models/pagemodel.py", line 26, in <module>
    from menus.menu_pool import menu_pool
  File "/home/vagrant/my-project/local/lib/python2.7/site-packages/menus/menu_pool.py", line 20, in <module>
    from menus.models import CacheKey
  File "/home/vagrant/my-project/local/lib/python2.7/site-packages/menus/models.py", line 30, in <module>
    class CacheKey(models.Model):
  File "/home/vagrant/my-project/local/lib/python2.7/site-packages/django/db/models/base.py", line 102, in __new__
    "INSTALLED_APPS." % (module, name)
RuntimeError: Model class menus.models.CacheKey doesn't declare an explicit app_label and isn't in an application in INSTALLED_APPS.

pdf upload

Extremely nice package. I find it very usefull when we use Django CMS using Filer for Document management. I've implemented your package to be able to use the same for image selection at frontend but I'm facing a problem for pdf and document management.
Are you planning to implement it? Or do you have a simple alternative?
Regards

documentation

I am having several issues setting up your module.
Could you go a little bit into more detail how to configure ckeditor?

'File' object has no attribute 'width'

I receive following error on selecting filer image as File class has no width/height properties, thus image can't be added to textarea.
Packages:
django==1.11.3
django-filer=1.2.7

django 2.0 support

File "/lib/python3.6/site-packages/ckeditor_filebrowser_filer/views.py", line 7, in
from django.core import urlresolvers
ImportError: cannot import name 'urlresolvers'

There is an error using django 2.0

URLs for Django >= 1.10

Could you change the urls.py so it can work on Django 1.10 ?
From what i've seen you just have to do this:


from django.conf.urls import url
from .views import *

urlpatterns = [
    url(r'version/$', filer_version, name='filer_version'),
    url(r'setting/(?P<setting>\w+)/$', get_setting, name='get_setting'),
    url(r'url_reverse/$', url_reverse, name='js_url_reverse'),
    url(r'url_image/(?P<image_id>\d+)/$', url_image, name='url_image'),
    url(r'url_image/(?P<image_id>\d+)/(?P<thumb_options>\d+)/$', url_image, name='url_image'),
    url(r'url_image/(?P<image_id>\d+)/(?P<width>\d+)/(?P<height>\d+)/$', url_image, name='url_image'),
    url(r'serve/(?P<image_id>\d+)/$', serve_image, name='serve_image'),
    url(r'serve/(?P<image_id>\d+)/(?P<thumb_options>\d+)/$', serve_image, name='serve_image'),
    url(r'serve/(?P<image_id>\d+)/(?P<width>\d+)/(?P<height>\d+)/$', serve_image, name='serve_image'),
    url(r'thumbnail_options/$', thumbnail_options, name='thumbnail_options'),
]

Great plugin by the way!!
Thanks

URL pattern incompatible with Django 2.2.25/3.1.14/3.2.10

This change in Django 2.2.25/3.1.14/3.2.10 breaks django-ckeditor-filebrowser-filer, because the path /filebrowser_filer/filer_version/ no longer matches any URL definitions.

Before this change, this URL definition would match because it doesn't start with a caret (^):

url(r'version/$', filer_version, name='filer_version'),

I'd open a PR, but I'm not sure if the proper solution would be to fix the URL definition or the JavaScript that requests this URL.

As a quick workaround, I added this URL definition to my project's urls.py:

url(r'^filebrowser_filer/filer_', include('ckeditor_filebrowser_filer.urls')),

No select button

I open popup with ckeditor, there is a button to insert image. Click on that and popup to select image from filer comes in. On that popup it is not possible to select image because there is no select button.

Here is my requirements file, maybe you could reproduce this bug. Thanks.
req.txt

FilerImage custom css works not

Hi,

Thanks for the new version.

I ran now across some other problem..

In the FilerImage plugin in CKeditor, you can specify on the second tab, custom css code.

Like i have placed an image through Filer in django-ckeditor and i want to give it padding: 10px; custom style.

But the ckeditor doesnt accepts it after hitting the ENTER button..

I checked allowedContent=True and removed stylesheetparser plugin from CKeditor config..

Does anybody know what this could be?

Greetings

Problem to change (modify src) an existing image

Click in "Edit Image"
image

then the image changes normally
image

Save your admin form
image

After of page reloaded, see again the ckeditor and realize that the image keep the same:
image

I found one solution and soon i am going to do a PR :)

Custom admin url

Is there a way to pass in the value for base_admin if you use a custom admin url?

Thanks,

Path "/filebrowser_filer/filer_version/" was changed and jQuery.get is returning 404

I think this path "/filebrowser_filer/filer_version/" changed to "/filebrowser_filer/version/"

The current call returns a 404

File:

jQuery.get('/filebrowser_filer/filer_version/', { }, function(data) {

It should change to
jQuery.get('/filebrowser_filer/version/', { }, function(data) {

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.