Shikhar
Ya I've installed it. Is there any other package
Prasanthari
Yes,but it's enough to use the image files
Prasanthari
Can u Share the models.py n views n html
Mendes
Mendes
for article in articles:
print(article.image_url)
Mendes
copy the path that will be printed on console and paste it on a browser tab, hit enter and see if it shows up...
Mendes
please, share with us the models.py, the problem should be there or on the way you are calling the field.
Mendes
if you don't want to share it, please double check if image_url is really a part of the articles model...
Mendes
you may had misspelled things, maybe...
Mendes
Here is an image from our friend https://prnt.sc/ppacbi
Mendes
Shikhar, as Prasanthari said, copy everything between src=" and "
Prasanthari
Did u mentioned image = models.ImageField(upload_to='folder') and add the folder under media??
Mendes
paste it on a browser tab and see if it shows anything at all
Shikhar
Shikhar
I've made a folder media and under that I made another folder as images
Shikhar
Should I give complete path
Mendes
No, the browser completes it for you...
Mendes
when you open https://yourdomain.tld/images/default_iAua525.jpg on a web broser it shows up the image?
Prasanthari
Media_url ='/media/'
Media_root = os.path.join(base_dir,'media') under settings.py??
Shikhar
Yes
Prasanthari
{{ article.img.url }} try this??
Mendes
The problem doesn't seem to be on the way he is calling the model...
Mendes
Mendes
the problem seems to be with the image itself, maybe on urls.py or the file itself wasn't uploaded...
Shikhar
Prasanthari
What's ur image field name??
Mendes
seems fine...
Shikhar
Prasanthari
Then try {{ article.Image_url.url }}
Macurrent
Is docker important for django developers??
Mendes
Mendes
it's important for all developers
Mendes
not only django
Prasanthari
Prasanthari
Like
Shikhar
Prasanthari
Great 😀
Mendes
Nice!
Mendes
Prasanthari, can you please explain me what was the problem?
Prasanthari
Working. Thanks pal
Check django documentation for more info, they've some examples took
Prasanthari
Too
Shikhar
Just one tiny problem why it is showing in card
Mendes
Mendes
Yeah, just can't get why it worked...
Shikhar
css probably
I've have used bootstrap. Anyways thanks I'll figure it out
Shikhar
Shikhar
This is the problem
Shikhar
Mendes
Mendes
I know the solution, but why it works?
Anyway, I will try to build something similar and see for myself...
Mendes
👌
Shikhar
Prasanthari
Bro it's just a manual error,he didn't use .url for render the image files he just used his field name
Mendes
Prasanthari
Mendes
so django diferentiates between path and image itself?
Prasanthari
Yes,if ur using in models the path doesn't matter.but if ur using it in static files the path is more imp
Shikhar
Prasanthari
Anonymous
Murshid
Why my session request.session.get('eventid') prints None instead of getting id. It prints when I using before my payment gateway page. But I need this id after successful transaction. But it shows none... Any one help me
Prasanthari
Anonymous
Anonymous
Can two Django projects have same Database ?
Anonymous
Anonymous
https://pastebin.com/aLxCdYTz
Anonymous
Anonymous
I want to retrieve data to my webpage from database
raven
Anonymous
Yes
Anonymous
Anonymous
In your <p>{{datas.fieldName}}</p>
raven
you are sending userinfo.objects.all() and maybe you are directly displaying them in you html. like {{datas}}
have a look at your userinfo model
use for loop to iterrate each object
use {{data.<fieldname>}} to get your output
raven