Django ImageField widget that accepts upload or external link as source
Asked Answered
P

2

9

Is there a Django widget for ImageFields that provides the option to either upload an image or provide a url?

I'm thinking like Summernote does (if you click the image icon) in its examples

I've browsed through many apps and they are all focused on just uploading and thumbnailing.

EDIT

Still working on trying to do be able to do this. I'm looking for something like the way django-summernote allows you to add images.

Also taking a look at this question about saving an image link into an ImageField. How can I get both to work together ina widget like Summernote?

Django save image from url and connect with ImageField

Postcard answered 24/12, 2016 at 23:4 Comment(0)
S
4

ImageFields based on FileField and can save only path to file with current media backend.

For save image from external url you should get link in separately form field and download this picture in tmp file and save to ImageFields.

Snappish answered 24/12, 2016 at 23:48 Comment(4)
DJango-summernote has an image widget that does this.Postcard
widget - it's not field. You can download image form url for save to ImageFields or simple save url to charfield or textfieldSnappish
Of course, but I'm looking for a widget that can handle both =)Postcard
Your answer is only relevant to the default widget.Postcard
P
0

No. This widget does not yet exist. You should make it.

Postcard answered 14/1, 2017 at 5:33 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.