Sorry, I’ m just a beginner in Django but I think what you need to look at is the “Fetch API”. https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API.  

https://www.youtube.com/watch?v=c3qWHnJJbSY

You can send an image through your view as HttpResponse(image_object in bytes/base64 format) object if request==”your desired one”. Then instead of your page reloading the fetch API will receivethe response and then you can use insertAdjacentHtml. For more details you can check the Django IRC channel   #django->https://webchat.freenode.net/ and ask there.

 

 

Sent from Mail for Windows 10

 

From: Ali Ahammad
Sent: 18 May 2020 18:02
To: Django users
Subject: Re: How to resize image from Django ckeditor_uploader in the HTML template while rendering?

 

thanx for your reply. i am using pillow in my profile app. but the main issue is with ckeditor_uploader as you know i have to use RichTextUploadingField(). besides it i have to mention in urls.py and i have to render it corresponding variable name in the template. my main goal was if i upload any picture in body=RichTextUploadingField() in localhost/admin, i want to render the image and the text contents separately. in this case i couldn't find any document where i can learn about it. i tried to use ckeditor widgets but it just customizing the ckeditor toolbar. i dun want this and i am happy with what i have for now.

 

so is there any way to render the uploading pic and resize and positioning in html template according to my own design? text can be separated and truncatchar:400 or 500 which i kew already. but i would like to separate the image from the text of the body. i hope you understand my problem

On Monday, May 18, 2020 at 12:49:53 PM UTC+1, Vishesh Mangla wrote:

You can resize an image using the Pillow library or open-cv.

 

Sent from Mail for Windows 10

 

From: Ali Ahammad
Sent: 17 May 2020 22:45
To: Django users
Subject: How to resize image from Django ckeditor_uploader in the HTML template while rendering?

 

I am using Django ckeditor_uploader to make a post view for a blog. But while rendering in the template I wanted to render image separately from the post content texts.

 

My main goal is to set the image separately on the template on top and resizing it. And I can set more pictures inside the post  but the top one will be highlighted and rendered in different HTML page.

 

Is there any way?

 

I tried to use ckeditor widget but it is just customizing the toolbar of ckeditor

 

Please let me know if you have any idea

 

--

You received this message because you are subscribed to the Google Groups "Django users" group.

To unsubscribe from this group and stop receiving emails from it, send an email to django...@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/4b148528-7b15-4d39-8763-5f3a0f1931b6%40googlegroups.com.

 

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/44ef45ba-68ce-4e08-a516-c7ff1a827ff5%40googlegroups.com.

 

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/5ec28c14.1c69fb81.ee3cc.aa1a%40mx.google.com.

Reply via email to