GithubHelp home page GithubHelp logo

froala / django-froala-editor Goto Github PK

View Code? Open in Web Editor NEW
279.0 13.0 71.0 14.64 MB

Package to integrate Froala WYSIWYG HTML rich text editor with Django.

Home Page: https://froala.com/wysiwyg-editor

Python 1.55% CSS 98.02% JavaScript 0.08% Shell 0.35%

django-froala-editor's Introduction

Django Froala WYSIWYG Editor

django-froala-editor package helps integrate Froala WYSIWYG HTML editor with Django.

Getting started

  1. Install the package:

pip install django-froala-editor

if not update in pypi use this

pip install https://github.com/froala/django-froala-editor/archive/master.zip

OR

Add the directory froala_editor from this repo to your Python path.

  1. Add froala_editor to INSTALLED_APPS in settings.py.

  2. Add the following line to urlpatterns in your application's urls.py.

from froala_editor import views

In your urlpatterns array add

path('froala_editor/',include('froala_editor.urls'))

Skip this url inclusion if you don't want image and file upload inside WYSIWYG editor. Images from URLs can still be embedded.

To add third-party plugins

In froala_editor\widgets.py add

'froala_editor/js/third_party/embedly.min.js',
'froala_editor/js/third_party/spell_checker.min.js',
'froala_editor/js/third_party/font_awesome.min.js',
'froala_editor/js/third_party/image_tui.min.js'

Usage

from django.db import models
from froala_editor.fields import FroalaField

class Page(models.Model):
  content = FroalaField()

FroalaField uses froala_editor.widgets.FroalaEditor as its widget. You may directly use this widget with any of your forms.py:

from django import forms
from froala_editor.widgets import FroalaEditor

class PageForm(forms.ModelForm):
  content = forms.CharField(widget=FroalaEditor)

Usage outside admin

When used outside the Django admin, the media files are to be manually included in the template. Inside the <head> section or before the form is rendered, include:

{{ form.media }}

Usage with virtual environment

To use Froala Editor in virtual environment, see https://tutorial.djangogirls.org/en/django_installation/ for how to setup virtual environment & to start your application in virtual environment.

Options

Froala Editor provides several options for customizing the editor. See https://froala.com/wysiwyg-editor/docs for all available options. You can provide a dictionary of these options as FROALA_EDITOR_OPTIONS setting in settings.py. These options would then be used for all instances of the WYSIWYG editor in the project.

Options for individual field can also be provided via FroalaField or FroalaEditor class. This overrides any options set via FROALA_EDITOR_OPTIONS:

from django.db import models
from froala_editor.fields import FroalaField

class Page(models.Model):
  content = FroalaField(options={
    'toolbarInline': True,
  })
from django import forms
from froala_editor.widgets import FroalaEditor

class PageForm(forms.ModelForm):
  content = forms.TextField(widget=FroalaEditor(options={
    'toolbarInline': True,
  }))

Theme

You may provide the name of the theme to be used as theme argument to FroalaField or FroalaEditor.

from django.db import models
from froala_editor.fields import FroalaField

class Page(models.Model):
  content = FroalaField(theme='dark')

FROALA_EDITOR_THEME can be set in settings.py making all instances of the editor to use a theme. However, theme argument in FroalaField and FroalaEditor overrides FROALA_EDITOR_THEME. Using a theme named 'dark' would require the existence of the file froala_editor/static/froala_editor/css/themes/dark.min.css. Available themes are: 'dark', 'gray' and 'red'.

Plugins

Froala Editor comes with the plugins: block style, text & background colors, font size, font family, insert video, insert table, media manager, lists and file upload. By default, all plugins are enabled by default in this package. See https://froala.com/wysiwyg-editor/docs/plugins for all available plugins.

FROALA_EDITOR_PLUGINS can be set in settings.py to tell which plugins should all instances of Froala Editor be using. By default, it is

FROALA_EDITOR_PLUGINS = ('align', 'char_counter', 'code_beautifier' ,'code_view', 'colors', 'draggable', 'emoticons',
        'entities', 'file', 'font_family', 'font_size', 'fullscreen', 'image_manager', 'image', 'inline_style',
        'line_breaker', 'link', 'lists', 'paragraph_format', 'paragraph_style', 'quick_insert', 'quote', 'save', 'table',
        'url', 'video')

The usage of plugins argument with FroalaEditor or FroalaField overrides this for that particular instance.

from django.db import models
from froala_editor.fields import FroalaField

class Page(models.Model):
  content = FroalaField(plugins=('font_size', 'font_family'))

Third party integrations

FROALA_EDITOR_THIRD_PARTY setting can be used to configure third party integrations. Aviary Image Editor and SCAYT Web SpellChecker are available for now. To enable, in settings.py:

FRAOLA_EDITOR_THIRD_PARTY = ('image_aviary', 'spell_checker')

Similar to plugin configuration, this can also be overridden on ForalaEditor and FroalaField.

Use your key for SCAYT Web SpellChecker with SCAYT_CUSTOMER_ID in your project setings.

Image upload

FroalaEditor and FroalaField optionally take in a boolean value for image_upload argument to enable or disable image uploads. Image uploads are enabled by default if the urls of this package are included in your urls.py.

You can use FROALA_UPLOAD_PATH setting in settings.py to change the path where uploaded files are stored within the MEDIA_ROOT. By default, uploads/froala_editor/images is used for storing uploaded images.

Other Settings

USE_FROALA_EDITOR - default True
If set to Falsein your Django settings disables Froala editor and uses a TextArea instead.

FROALA_STORAGE_BACKEND
This allows for the storage used for uploaded images and files to be changed through settings. If nothing is provided it uses default_storage, otherwise it uses this backend. Using this you can specify a different storage backend like S3 only for Froala.

FROALA_JS_COOKIE - default False.
If set to True, it assumes js-cookie is installed and included to get the CSRF token using js-cookie.

Release

To publish to PyPi, the following command should be run:

python setup.py sdist upload -r pypi

License

This package is available under BSD License. However, in order to use Froala WYSIWYG HTML Editor plugin you should purchase a license for it.

See https://froala.com/wysiwyg-editor/pricing for licensing the Froala Editor.

If you bought a license and got your key, the easiest way to implement it is to put it into the FROALA_EDITOR_OPTIONS setting in settings.py:

FROALA_EDITOR_OPTIONS = {
  'key': '<our key goes here>',
  # other options
  # ...
}

django-froala-editor's People

Contributors

alvaxet avatar bigjust avatar carocha avatar dheerajaccolite avatar dianaprajescu avatar dustingtorres avatar froala-travis-bot avatar goodtune avatar govardhancel avatar harasunu-narayan avatar isdipesh avatar kapil2704 avatar mattijevi avatar mpibpc-mroose avatar raucodes avatar shreypasari-accolite avatar skyflyer avatar ssibrahimpur avatar stefanneculai avatar whoknowwhat 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar

django-froala-editor's Issues

Latest release 2.4.0 is not found in PyPi

if I issue this command a very old version(2.0.1) is invoked for installation.

$ pip install django-froala-editor
Collecting django-froala-editor
Installing collected packages: django-froala-editor
Successfully installed django-froala-editor-2.0.1

$ pip install django-froala-editor==2.4.0
Collecting django-froala-editor==2.4.0
  Could not find a version that satisfies the requirement django-froala-editor==2.4.0 (from versions: 0.8.0, 0.8.1, 0.8.2, 0.8.3, 0.8.4, 0.8.5, 0.8.6, 0.8.7, 0.9.0, 1.2.1, 1.2.2, 1.2.3, 1.2.3.1, 1.2.3.2, 1.2.4, 1.2.4.1, 1.2.4.2, 1.2.5, 1.2.6, 1.2.7, 2.0.0rc3, 2.0.0rc3.post1, 2.0.1)
No matching distribution found for django-froala-editor==2.4.0

Can't submit form because froala editor field is required but hidden

I have a problem where I can't submit my form because my description textarea is required but hidden in my form. Any idea how I can solve this? I have no idea where style="display:none;" is coming from. Any idea?

class CustomFroalaEditor(FroalaEditor):
    def __init__(self, *args, **kwargs):
        super(CustomFroalaEditor, self).__init__(*args, **kwargs)

    def render(self, name, value, attrs=None, renderer=None):
        html = super(FroalaEditor, self).render(name, value, attrs)
        return mark_safe(html)


class NewBlaForm(forms.ModelForm):
    description = forms.CharField(widget=CustomFroalaEditor(attrs={'id': 'nb__description-editor'}))

    class Meta:
        model = Bla
        fields = ('description')

image

Using the license key

In your README you have mentioned this is how we should use the key

FROALA_EDITOR_OPTIONS = { 'KEY': '<our key goes here>', # other options # ... }

but this doesn't work because Froala is expecting a lowercase 'key' instead of the uppercase 'KEY'. Either change the documentation or change the code on widgets.py etc to convert to lowercase always.

Pip install does not fetch the latest version

Expected behavior.

Install the latest django-froala-editor version.

Actual behavior.

Install the django-froala-editor version 2.0.1.

Steps to reproduce the problem.

(using virtualenvwrapper to ease the test)

mktmpenv
pip search froala
pip install django-froala-editor

The version 2.0.1 gets installed, even though the 2.3.2 is present on the pypi website and the pip search shows a 2.1.0 version.

screen shot 2016-06-13 at 10 40 41

OS.

OS X Yosemity 10.10.5
pip version 8.1.2
python 2.7

EDIT

Following this conversation I've been able to install the latest version of the editor, but the issue remains.

Options on widget can not be set dynamically

We have several froala editors on the same page where we need to set the maxCharacters option dynamically for each one.

Since all the editors are on the same Model the options instance used in the model is used for each editor. This means that when we set the value dynamically all the editors get the same value.

Heres some code showing what we do:

            forms[x].fields['foo'].widget.options['maxCharacters'] = bar.maxchars

A workaround is to use copy on widget.options before settings the value like so:

            forms[x].fields['foo'].widget.options = copy(forms[x].fields['foo'].widget.options)
            forms[x].fields['foo'].widget.options['maxCharacters'] = bar.maxchars

I think it would be cleaner if that was done in django-froala-editor.

Error in readme

From the readme

from django import forms
from froala_editor.widgets import FroalaEditor

class PageForm(forms.ModelForm):
    content = models.TextField(widget=FroalaEditor)

It's wrong its supposed to be

from django import forms
from froala_editor.widgets import FroalaEditor

class PageForm(forms.ModelForm):
    content = forms.CharField(widget=FroalaEditor)

image_tui plugin doesn't seem to be doing much

Trying to use image_tui, added it like so:

FROALA_EDITOR_THIRD_PARTY = ('image_tui', 'spell_checker', 'font_awesome', 'embedly')

Everything else seems to be working fine, but when I click on the button for advanced image editing, nothing seems to be happening. Using Django 2.1 on Firefox and Chrome.

Image upload

When uploading images the uploaded image is saved to uploads/froala_editor/images but the image does not appear in the editor or the html. This happens in forms and admin.

Steps taken to install:
pip install django-froala-editor
url(r'^froala_editor/', include('froala_editor.urls')), added to urlpatterns
Form.py has charfield with the widget set to Froala (widget=FroalaEditor)

License key not removing warning message

I've paid for Froala and generated a license key on the froala website.
I've inserted the key into my settings file using
`FROALA_EDITOR_OPTIONS = {
'KEY': 'MY_KEY_IS HERE',

}`

But I still see the message 'Unlicensed Froala editor' in admin.

Uncaught ReferenceError: $ is not defined

I used FroalaField() in models.py and included css and js files to my base html. But looks like this function does not work.
<script> $(function(){ $('#id_description').froalaEditor({"inlineMode": false, "imageUpload": false, "fileUpload": false}) }); </script>

it says on javascript console

Uncaught ReferenceError: $ is not defined

also I have this error

Uncaught TypeError: Cannot read property 'fn' of undefined
at froala_editor.min.js:7
at froala_editor.min.js:7
at froala_editor.min.js:7

field.help_text does not show with widget set to froala_editor.

I have a model form:

class TeachersCourseProfileForm(forms.ModelForm):
     text = forms.CharField(widget=FroalaEditor)

class Meta:
    model = CourseOwner
    fields = (... , 'text', ... )

when I display the form with widget set to Froala editor for the text field, then field.help_text comes back empty. If I remove the widget it contains the help_text that I specified in the model for that field. This seems like a bug to me. I think the models fields help_text should be preserved. This is my model:

class CourseOwner(TimeStampedModel):
    """
    Relationship of Courses to Accounts through the Relationship of teaching.
    """
    ...
   text = models.TextField(verbose_name='Text',
                        help_text='''Personenbeschreibung: was qualifiziert Dich für das Halten dieses
                        Kurses?''',
                        blank=True)

Filtering by FroalaField()

I have a model with FroalaField() and I want to filter data by the field. Unfortunately the Model.objects.filter() doesnt have option to filter by field__contains. How do I search on the field?

cannot import name JsonResponse

Hi,

I'm trying to install Froala for a front end form on my site. I'm getting the error: cannot import name JsonResponse and I'm not quite sure what's causing it? I'm probably missing something, but I've went over the docs a couple times and don't seem to be missing anything. Any ideas?

Traceback:
File "/Users/Deron/Sites/project/virtualenv/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response

  1.                 resolver_match = resolver.resolve(request.path_info)
    
    File "/Users/Deron/Sites/project/virtualenv/lib/python2.7/site-packages/django/core/urlresolvers.py" in resolve
  2.         for pattern in self.url_patterns:
    
    File "/Users/Deron/Sites/project/virtualenv/lib/python2.7/site-packages/django/core/urlresolvers.py" in url_patterns
  3.     patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
    
    File "/Users/Deron/Sites/project/virtualenv/lib/python2.7/site-packages/django/core/urlresolvers.py" in urlconf_module
  4.         self._urlconf_module = import_module(self.urlconf_name)
    
    File "/Users/Deron/Sites/project/virtualenv/lib/python2.7/site-packages/django/utils/importlib.py" in import_module
  5. **import**(name)
    
    File "/Users/Deron/Sites/project/project/project/urls.py" in
  6. url(r'^froala_editor/', include('froala_editor.urls')),
    
    File "/Users/Deron/Sites/project/virtualenv/lib/python2.7/site-packages/django/conf/urls/init.py" in include
  7.     urlconf_module = import_module(urlconf_module)
    
    File "/Users/Deron/Sites/project/virtualenv/lib/python2.7/site-packages/django/utils/importlib.py" in import_module
  8. **import**(name)
    
    File "/Users/Deron/Sites/project/virtualenv/lib/python2.7/site-packages/froala_editor/urls.py" in
  9. from froala_editor import views
    File "/Users/Deron/Sites/project/virtualenv/lib/python2.7/site-packages/froala_editor/views.py" in
  10. from django.http import JsonResponse

Exception Type: ImportError at /
Exception Value: cannot import name JsonResponse

Feature request: Make the Froala Editor deactivatable

I'm a fan of behavior testing using Splinter which bases on Selenium. The problem with a FroalaField in those tests is, that they are not rendered as form fields and so they can not get filled by the default Selenium/Splinter methods. So I would like to be able do deactivate the FroalaEditor when running those tests using settings.py.

As a proof of concept I implemented this as follows:

from django.conf import settings
from froala_editor.fields import FroalaField
from django.forms.widgets import Textarea


class DeactivatableFroalaField(FroalaField):
    """
    FroalaField which allows to disable the FroalaEditor widget
    using settings.py's variable USE_FROALA_EDITOR
    """
    def formfield(self, **kwargs):
        try:
            use_froala_editor = settings.USE_FROALA_EDITOR
        except AttributeError:
            use_froala_editor = True

        if use_froala_editor is False:
            # disable the Froala Editor by just
            # rendering a Textarea
            defaults = {
                'widget': Textarea()
            }
            defaults.update(kwargs)

            return super(DeactivatableFroalaField, self).formfield(**defaults)
        else:
            # leave as it is
            return super(DeactivatableFroalaField, self).formfield(**kwargs)

As this is quite useful for me, I kindly ask the developers to "incorporate" this idea into the code base.

Image format is blob while copying images from Microsoft Word and only work in Chome

While I want to copy an article from Microsoft Word including a lot of images embed in Word, the image can only be uploaded as blob in Django's media root like the screenshot below.
image
And sometimes, this can only upload one image, not all images. Also, this action only works on Chrome, and Safari does not work.

And my version is below

  • Django (1.11)
  • django-froala-editor (2.5.1)
  • djangorestframework (3.6.2)
  • mysqlclient (1.3.10)
  • olefile (0.44)
  • Pillow (4.1.1)
  • pip (9.0.1)
  • pytz (2017.2)
  • setuptools (28.8.0)

The main codes is below

# settings.py
INSTALLED_APPS = [
    ...
    'froala_editor',
    ...
]
...

MEDIA_ROOT = os.environ.get('MEDIA_ROOT', os.path.join(BASE_DIR, 'media'))
MEDIA_URL = '/media/'
STATIC_ROOT = os.environ.get('STATIC_ROOT', os.path.join(BASE_DIR, 'static'))
STATIC_URL = '/static/'

STATICFILES_DIRS = (
    os.path.join(BASE_DIR, "static_media"),
)

FROALA_EDITOR_PLUGINS = (
    'align', 'char_counter', 'code_beautifier', 'code_view', 'colors', 'draggable', 'emoticons',
    'entities', 'file', 'font_family', 'font_size', 'fullscreen', 'image_manager', 'image',
    'inline_style',
    'line_breaker', 'link', 'lists', 'paragraph_format', 'paragraph_style', 'quick_insert',
    'quote', 'save', 'table',
    'url', 'video'
)
# urls.py
urlpatterns = [
    ...
    url(r'^froala_editor/', include('froala_editor.urls')),
]

urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
# models.py
...
class Article(models.Model):
    content = FroalaField(options={
        'heightMin': 400
    })
...

pip install does not fetch the latest version

My deployment process uses AWS and relies and automatic installation of requirements using

pip install

currently it only installs django-froala-editor-2.9.5
and not the newer django-froala-editor-3.0.0b1

When I reedit a textfield certain formating such as color is gone

I do not know how to fix this. When I first format a text, everything works fine. I can add colors and tables and much more. But when I try to update and open the text in my form again, certain formating has disappeared. Can you please help me with this. The formating seems to be stored in the database, since everything shows in the Detail view, just when I reload my update form Things go wrong.

Uncaught TypeError: $(...).froalaEditor is not a function

I remember using this app in my last project without any problem but this time, I get this error on my console. I could use the app in admin page, but when I try to use it outside using {{form.media}} I get the above error. Why is this occurring and how do I fix this? Is it me doing it wrong or new version of froala?(because I used this app without any problem last time, and I loved it)

Something went wrong (403, csrf token is null) when trying to upload an image.

I am using django forms with FroalaEditor from froala_editor.widgets. The image uploading works fine when I upload it in my local server. But when I push the code to a Ec2 server instance and try uploading an image using the froala field, an Error pops, saying "Something went wrong please try again"

Its a 403 error.
When I looked in the network, the cookie in the request headers is generated
Cookie:csrftoken=*********************************************************************

but the csrfmiddlewaretoken in the formData is NULL.

Again it works fine when I try it in my local. When I host it on server, its causing this issue. Please help

render() got an unexpected keyword argument 'renderer'

I had a problem when I trying to implement the Froala Editor in my DJango Application... I leave here the error Stack. If you know what's the problem please, tell me know. 👍

image
image

I followed all installed instruction strictly. I don't know what happen
Version of Froala Editor: v2.8.4

Disabling auto-formatting on `code` view

Hello,

Froala doesn't seem to handle django/jinga template tags too well. For example, it automagically wraps for loops (i.e {% for i in y %}) in paragraph tags.

This is frustrating but somewhat manageable, however the real issue comes in when dealing with tables. If I have a for loop that sits outside of a tag inside a table, it would take it and append it into single string paragraph at the top.

For example,

<table>
<tr>
{% for user in users %}
<td>{{ user.first_name }}</td>
{% endfor %}
</tr>
</table>

Would become

<p>{% for user in users %} {% endfor %}</p>
<table>
<tr>
<td>{{ user.first_name }}</td>
</tr>
</table>

Even if I'm entering it view the "code" view. This of course makes it unusable for this purpose.

Is there a way to disable formatting, at least when entering things via the "code" view? Or a way to make {{ foo }} and {% bar %} exempt from auto-formatting?

Forgive my horrible regex, but I'd like to spare the following three inputs from autoformatting:

  1. ({{)(.*)(}}) (i.e {{ foo }})
  2. ({% for)(.*)(endfor %}) (i.e {% for i in x %} foo {% endfor %})
  3. ({% if)(.*)(endif %}) (i.e {% if bar %} foo {% else %} foobar {% endif %})

Cannot integrate froala in Django Admin

Hello all,

I am trying to integrate Froala editor within django admin. I understood from the doc that the process is pretty straight forward.
I followed the getting started and usage part of the documentation here https://github.com/froala/django-froala-editor.

I created in my model.py :

from froala_editor.fields import FroalaField
from django.db import models

class Service(models.Model):
    message = FroalaField()

When I log in the admin interface, the field shows as a textarea.

Do you have any idea why ? Am I doing something wrong?

Many thanks,

Bug in python3.4

Hi

Django Version: 1.7
Exception Type: TypeError
Exception Value:
unsupported operand type(s) for +: 'dict_items' and 'dict_items'
Exception Location: /usr/local/lib/python3.4/dist-packages/froala_editor/widgets.py in get_options, line 30
Python Executable: /usr/bin/python3.4
Python Version: 3.4.1

Cannot find reference 'S3' in '__init__.py'

I am using django-froala-editor to generate a signature and policy and these policy and signature both will be returned to my Front end which is build in Angular 5.

I am following this link to make it work in django but I am getting syntax error

Cannot Find reference 'S3' in 'init.py'

On the following line of code.
from floara-editor import S3

screenshot_27

Please help.

not working with Django 1.7

Please change keyword argument "mimetype" to "content_type" when creating an HTTPResponse object in froala_editor/views.py.
This works out for me.

Froala widget dosn't work in forms.py!

I import froala and set for CharField.widget
But show CharField (<textarea>) again!

class PostForm(forms.ModelForm):
    content = forms.CharField(widget=FroalaEditor),

    class Meta:
        model = models.Post
        fields = ('text',)

django-froala-editor issue with Django 1.10.4

Hello,
I was just trying out Froala (don't have a license at the moment).
Documentation at this time has no references about setting it up on Django 1.10.x (maybe I'm missing something?). In order to get it working, file lib/python2.7/site-packages/froala_editor/urls.py should be modified as follows:

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

urlpatterns = [
    url(r'^image_upload/$', views.image_upload, name='froala_editor_image_upload'),
    url(r'^file_upload/$', views.file_upload, name='froala_editor_file_upload'),
]

patterns() has been deprecated since Django 1.8

Problems with insert link (and others) - hidden overflow and labels too high

A picture is worth a thousand words :)
screen shot 2018-01-15 at 13 29 30

  1. You can see that the "Insert link" is hidden, because the editor does not have enough height.
  2. When you fix the overflow, the label is too high and thus the input is not visible.

The reason for the first issue is this CSS part (from forms.css):

.form-row {
    overflow: hidden;
    padding: 10px;
    font-size: 13px;
    border-bottom: 1px solid #eee;
}

The reason for the second issue this CSS part (from forms.css):

.aligned label:not(.vCheckboxLabel):after {
    content: '';
    display: inline-block;
    vertical-align: middle;
    height: 26px;
}

I temporarily fixed those issues with a custom CSS added to the admin:

div.form-row {
    overflow: visible;
}

.aligned label:not(.vCheckboxLabel):after {
    content: none;
}

I can prepare a pull request with this fix if you'd like. I'm not sure what other (unwanted) effects could the overflow:visible have though.

I tested this with Django 1.11.4 and 1.11.9 and django-froala-editor 2.7.3.

403 when uploading images

Wasn't sure if you are getting notifications on closed issues, so I thought I'd open a new ticket. This is in relation to this issue: #5

After updating, image upload only works when I add the csrf_exempt decorator back to the view. Otherwise, I get a 403 error in terminal when trying to upload images. Any ideas?

csrf exempt?

I noticed in the image upload view, there's a decorator for csrf_exempt. I admit I'm not anywhere near a django expert, but I was under the impression the csrf token was there as a way to block rogue form submissions? Or to ensure the form submission came from where you think it came from?

If the image upload is csrf exempt, I assume that means it doesn't need a csrf token to upload images? Assuming that's accurate, what's to stop someone from viewing the html source of my page, grabbing the froala image upload path setting and uploading some kind of harmful code to my image directory from their own form?

Is it free?

Hi,

If I install this package on my Django project, do I need to buy a license to use it?

Upload and use image file

Dear authors,
I've just used django-froala-editor, of course I followed your tutorial and I met problem with upload and use image file function.
From interface, I uploaded a file and approximately appeared the error:

something went wrong. Please try again

And then, I checked the default folder for storing data: "uploads/froala_editor/images", I can see the file that uploaded.
Also, I check the log file and see that:

Not Found: /admin/article/article/add/uploads/froala_editor/images/btn-login_Lp5ADiP.png/change/

So I would like to ask you about the parameter that I can set to change the directory for load image, I mean from /admin/article/article/add/uploads/froala_editor/images/ to uploads/froala_editor/images

Second question, from TextEditor, I clicked "Insert Image" and see the button "Browse folder". I click this and see tab "Manage Image" but maybe this for server online, I could not mange it well.
So how can I change the content of the tab for suitable of my purpose.

I'm waiting for your feedback. :)

Thanks and best regards,

new release no exist in pypi

Hi, when i install with this command
pip install django-froala-editor
Collecting django-froala-editor
Installing collected packages: django-froala-editor
Successfully installed django-froala-editor-2.0.1

this version install 2.0.1 is incompatible with django 1.10.2, the only way install is dowload
for repository and put in my root folder,

but my question is why is not posible install with pip
pip install django-froala-editor==2.3.5
Collecting django-froala-editor==2.3.5
Could not find a version that satisfies the requirement django-froala-editor==2.3.5 (from versions: 0.8.0, 0.8.1, 0.8.2, 0.8.3, 0.8.4, 0.8.5, 0.8.6, 0.8.7, 0.9.0, 1.2.1, 1.2.2, 1.2.3, 1.2.3.1, 1.2.3.2, 1.2.4, 1.2.4.1, 1.2.4.2, 1.2.5, 1.2.6, 1.2.7, 2.0.0rc3, 2.0.0rc3.post1, 2.0.1)

thank any help

General question regarding the editor

This editor looks really nice and I might even give it a shot at replacing TinyMCE 4 on a site. I'm wondering though, does django-froala-editor make it easy to upload images into the body field? I see that's an option in their demo, but that would be a pretty big requirement for me; easy image uploads.

Froala not working in Django admin's inlines

In Django admin, using FroalaField/FroalaWidget in inline model breaks the editor. No Froala buttons can be pressed, characters are not counted, placeholder doesn't disappear, no content is saved after submission.
This might be a general problem with formsets.

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.