Why is part of the column data output from the database?
Hi cloudinary!
I use cloudinary for storage of pictures. I upload them through my Django own admin panel:
images = CloudinaryField('images', null=False, width_field='image_width', height_field='image_height')
in sqllite I get image /upload/v1574103384/hdvil4trb3bdijby74u8.jpg, which suits me.
In the admin panel general direct link:

I output to the template like this:
<img class="main_img" src='{{ post.images }}' alt="{{ post.title }}">
I get:
<img class="main_img" src="vcoxk9dkjgfqfjicr1dl" alt="test text">
Why am I not getting a normal link?
-
Hi,
It seems like you are being returned with the string, which is the public_id of the asset.
I would recommend using Django template tags to generate the URL.
For example, you can include the following in your template -
{% load cloudinary %}and
{% cloudinary "{{ post.images }}" width=100 height=150 crop="fill" %}More information on integrating with Django is available in our documentation here:
https://cloudinary.com/documentation/django_image_manipulation
Hope this helps!
1 -
Hi Brian, and thanks for the help!
{% cloudinary post.images alt=post.title %}This help my =)
0
Post is closed for comments.
Comments
2 comments