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
After I click on edit as html a box appears on the place where inspector code is opened
prepend this before the return on the index(request) located at views.py
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
Can u Share the models.py n views n html
views and html: https://pastebin.com/ppFVfPjM
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
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
Here is an image from our friend https://prnt.sc/ppacbi
is being rendered properly, the path...
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
Media_url ='/media/' Media_root = os.path.join(base_dir,'media') under settings.py??
urlpatterns = [ path('admin/', admin.site.urls), path('inblog/', include('inblog.urls')), ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
Mendes
seems fine...
Mendes
What's ur image field name??
is being rendered properly, the problem doesn't seem to be in the path itself, but on the image...
Prasanthari
Then try {{ article.Image_url.url }}
Macurrent
Is docker important for django developers??
Mendes
it's important for all developers
Mendes
not only django
Prasanthari
Prasanthari
Like
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
Yeah, just can't get why it worked...
Shikhar
css probably
I've have used bootstrap. Anyways thanks I'll figure it out
Shikhar
This is the problem
Shikhar
This is the problem
I mean solution 😅
Mendes
This is the problem
Yeah, haha...
Mendes
I know the solution, but why it works? Anyway, I will try to build something similar and see for myself...
Mendes
👌
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
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
Yes,if ur using in models the path doesn't matter.but if ur using it in static files the path is more imp
I remember when I'm using url instead of media files for images I don't have to use .url
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
Anonymous
Can two Django projects have same Database ?
Viktor
Can two Django projects have same Database ?
I don't know why do you want this setup, but yes
raven
Can two Django projects have same Database ?
i guess yes if you use postgres ,mysql like db
Anonymous
https://pastebin.com/aLxCdYTz
Anonymous
raven
https://pastebin.com/aLxCdYTz
can you tell me what exactly you want?
Anonymous
I want to retrieve data to my webpage from database
Anonymous
Yes
Anonymous
You send that through pastebin and let them check
HTML https://pastebin.com/r1DNddz6
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