GithubHelp home page GithubHelp logo

Comments (7)

isDipesh avatar isDipesh commented on July 28, 2024

Yes, the editor is very nice and I've replaced redactor with this editor myself. django-froala-editor does support image uploads, just make sure you are including the url as instructed in Getting Started section of the readme.

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

url(r'^froala_editor/', include('froala_editor.urls')),

Including this url makes the view for saving the uploaded image available. Images from remote URLs can still be embedded without this.

from django-froala-editor.

deronsizemore avatar deronsizemore commented on July 28, 2024

Thank you! Sounds great. Wish I had this a few months back when I was fighting with getting image uploads working with TinyMCE 4. I'll likely use this going forward.

from django-froala-editor.

davemutton avatar davemutton commented on July 28, 2024

I've followed these instructions and I'm struggling to get image uploads working. Are there any other settings?

from django-froala-editor.

deronsizemore avatar deronsizemore commented on July 28, 2024

@davemutton I did a lot of customization on my end to get things working how I wanted with Froala. I used the option that Froala provides for image upload url: https://editor.froala.com/options#imageUploadURL and then created my own view which handles the image upload.

from django-froala-editor.

davemutton avatar davemutton commented on July 28, 2024

@deronsizemore
Am you able to.share that view? I'm not sure where to start

from django-froala-editor.

deronsizemore avatar deronsizemore commented on July 28, 2024

@davemutton I'm actually using the django-froala app and started with their view which is here: https://github.com/froala/django-froala-editor/blob/master/froala_editor/views.py#L10

I set my imageUploadURL option for Froala to:

imageUploadURL: "/froala/image_upload/",

I also found that I needed to pass in the csrf_token to the upload view, so I have this option for Froala also:

imageUploadParams: {'csrfmiddlewaretoken': '{{ csrf_token }}'},

I'm initializing Froala right inside of my

tag so that I can pass in the csrf_token.

If it will help, here's my exact view for uploading: http://pastebin.com/h1ffPZ5V

Heavily customized as you can see, but I started with the base django-froala view from above. I customized it because I'm storing uploads to Amazon S3

Hope that helps.

from django-froala-editor.

davemutton avatar davemutton commented on July 28, 2024

Thanks.. That gives me a place to start!

from django-froala-editor.

Related Issues (20)

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.