Re: how to Display images other than from static folder.

2022-02-01 Thread RANGA BHARATH JINKA
Hi,

Please follow this.
https://djangocentral.com/managing-media-files-in-django/
You have to store your images in a static media folder by adding the media
path in settings.py.
This is the recommended way and easy to access the images

All the best

On Wed, Feb 2, 2022 at 11:30 AM RANGA BHARATH JINKA <
bharathjink...@gmail.com> wrote:

> Hi,
>
> Pass the pdf URL as a context variable in the views function. Then you can
> easily access it in your HTML using jinja templating and HTML anchor tag  href="{{pdf_url}}"  download target="__blank" />
>
> All the best
>
> On Wed, Feb 2, 2022 at 11:03 AM ramsha azhar 
> wrote:
>
>> still, I'm confused, Guide me what to write in views.py to display images
>> on my HTML page.
>> the main problem is how to set this path in views.py file to get image
>> from this path. I jst want to display this tree.pdf file on my html page.
>> Any one tell me what to write in views.py?
>> BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
>> filename = 'Tree.pdf'
>> filepath = BASE_DIR + '//' + filename
>> path = open(filepath, 'rb')
>>
>> On Mon, Jan 31, 2022 at 9:00 PM ramsha azhar 
>> wrote:
>>
>>> yes, I set check the attached settings.py file
>>>  just want to know In template page how I set the path od
>>> back directory folder where tree.png is placed.
>>>
>>> On Mon, Jan 31, 2022 at 8:55 PM DJANGO DEVELOPER <
>>> abubakarbr...@gmail.com> wrote:
>>>
 have you set up the static files in settings.py ?

 On Mon, Jan 31, 2022 at 8:49 PM ramsha azhar 
 wrote:

> I just want to display the attached Tree.png image on the HTML page
> but this image is created each time new according to the user input file.
> guide me how to set the path of this mage on an HTML page or how to 
> display
> this tree.png as a user output image.
>
> On Mon, Jan 31, 2022 at 8:36 PM DJANGO DEVELOPER <
> abubakarbr...@gmail.com> wrote:
>
>> tell me what you want to get as a result? do you want to display
>> multiple images on HTML template?
>>
>> On Mon, Jan 31, 2022 at 8:27 PM ramsha azhar 
>> wrote:
>>
>>> So guide me the write way ...
>>>
>>> On Mon, 31 Jan 2022, 7:45 pm DJANGO DEVELOPER, <
>>> abubakarbr...@gmail.com> wrote:
>>>
 you are doing it the wrong way. totally the wrong way. I am not
 being rude.

 On Mon, Jan 31, 2022 at 7:42 PM ramsha azhar <
 ramshaazha...@gmail.com> wrote:

> Gide me Django develpers. I just want to display my pictures that
> are created each time new.
> My mages are created in my project folder, not in the static
> folder.
> how I display images on the HTML page by using the path of my
> project folder.
>
> views.py
>
> def Image_display(request):
>   BASE_DIR =
> os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
>   filename = 'Tree.jpg'
>   filepath = BASE_DIR + '//' + filename
>   images = Image.objects.all('filepath')
>   return render(request, "xyz.html", {'images': images})
>
> url.py
> path('Image_display/', views.Image_display, name="Image_display"),
>
> HTML page
> 
> 
> 
> 
>
> --
> 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/8da245ea-ea90-4730-83c0-accafc93b86bn%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/CAKPY9p%3DE1FmUc%3Dqqy1tGYBJbimFX873XXSTDndnn4kVUjo3ZWg%40mail.gmail.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
>>> 

Re: how to Display images other than from static folder.

2022-02-01 Thread RANGA BHARATH JINKA
Hi,

Pass the pdf URL as a context variable in the views function. Then you can
easily access it in your HTML using jinja templating and HTML anchor tag 

All the best

On Wed, Feb 2, 2022 at 11:03 AM ramsha azhar 
wrote:

> still, I'm confused, Guide me what to write in views.py to display images
> on my HTML page.
> the main problem is how to set this path in views.py file to get image
> from this path. I jst want to display this tree.pdf file on my html page.
> Any one tell me what to write in views.py?
> BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
> filename = 'Tree.pdf'
> filepath = BASE_DIR + '//' + filename
> path = open(filepath, 'rb')
>
> On Mon, Jan 31, 2022 at 9:00 PM ramsha azhar 
> wrote:
>
>> yes, I set check the attached settings.py file
>>  just want to know In template page how I set the path od
>> back directory folder where tree.png is placed.
>>
>> On Mon, Jan 31, 2022 at 8:55 PM DJANGO DEVELOPER 
>> wrote:
>>
>>> have you set up the static files in settings.py ?
>>>
>>> On Mon, Jan 31, 2022 at 8:49 PM ramsha azhar 
>>> wrote:
>>>
 I just want to display the attached Tree.png image on the HTML page but
 this image is created each time new according to the user input file. guide
 me how to set the path of this mage on an HTML page or how to display this
 tree.png as a user output image.

 On Mon, Jan 31, 2022 at 8:36 PM DJANGO DEVELOPER <
 abubakarbr...@gmail.com> wrote:

> tell me what you want to get as a result? do you want to display
> multiple images on HTML template?
>
> On Mon, Jan 31, 2022 at 8:27 PM ramsha azhar 
> wrote:
>
>> So guide me the write way ...
>>
>> On Mon, 31 Jan 2022, 7:45 pm DJANGO DEVELOPER, <
>> abubakarbr...@gmail.com> wrote:
>>
>>> you are doing it the wrong way. totally the wrong way. I am not
>>> being rude.
>>>
>>> On Mon, Jan 31, 2022 at 7:42 PM ramsha azhar <
>>> ramshaazha...@gmail.com> wrote:
>>>
 Gide me Django develpers. I just want to display my pictures that
 are created each time new.
 My mages are created in my project folder, not in the static folder.
 how I display images on the HTML page by using the path of my
 project folder.

 views.py

 def Image_display(request):
   BASE_DIR =
 os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
   filename = 'Tree.jpg'
   filepath = BASE_DIR + '//' + filename
   images = Image.objects.all('filepath')
   return render(request, "xyz.html", {'images': images})

 url.py
 path('Image_display/', views.Image_display, name="Image_display"),

 HTML page
 
 
 
 

 --
 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/8da245ea-ea90-4730-83c0-accafc93b86bn%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/CAKPY9p%3DE1FmUc%3Dqqy1tGYBJbimFX873XXSTDndnn4kVUjo3ZWg%40mail.gmail.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/CAMyb2%3DheLgJo5dMxsCgQ8cm%3Dp0px5EHpLr2frYtDowV8mmC%2BbQ%40mail.gmail.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
> 

Re: how to Display images other than from static folder.

2022-02-01 Thread ramsha azhar
still, I'm confused, Guide me what to write in views.py to display images
on my HTML page.
the main problem is how to set this path in views.py file to get image from
this path. I jst want to display this tree.pdf file on my html page.
Any one tell me what to write in views.py?
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
filename = 'Tree.pdf'
filepath = BASE_DIR + '//' + filename
path = open(filepath, 'rb')

On Mon, Jan 31, 2022 at 9:00 PM ramsha azhar 
wrote:

> yes, I set check the attached settings.py file
>  just want to know In template page how I set the path od
> back directory folder where tree.png is placed.
>
> On Mon, Jan 31, 2022 at 8:55 PM DJANGO DEVELOPER 
> wrote:
>
>> have you set up the static files in settings.py ?
>>
>> On Mon, Jan 31, 2022 at 8:49 PM ramsha azhar 
>> wrote:
>>
>>> I just want to display the attached Tree.png image on the HTML page but
>>> this image is created each time new according to the user input file. guide
>>> me how to set the path of this mage on an HTML page or how to display this
>>> tree.png as a user output image.
>>>
>>> On Mon, Jan 31, 2022 at 8:36 PM DJANGO DEVELOPER <
>>> abubakarbr...@gmail.com> wrote:
>>>
 tell me what you want to get as a result? do you want to display
 multiple images on HTML template?

 On Mon, Jan 31, 2022 at 8:27 PM ramsha azhar 
 wrote:

> So guide me the write way ...
>
> On Mon, 31 Jan 2022, 7:45 pm DJANGO DEVELOPER, <
> abubakarbr...@gmail.com> wrote:
>
>> you are doing it the wrong way. totally the wrong way. I am not being
>> rude.
>>
>> On Mon, Jan 31, 2022 at 7:42 PM ramsha azhar 
>> wrote:
>>
>>> Gide me Django develpers. I just want to display my pictures that
>>> are created each time new.
>>> My mages are created in my project folder, not in the static folder.
>>> how I display images on the HTML page by using the path of my
>>> project folder.
>>>
>>> views.py
>>>
>>> def Image_display(request):
>>>   BASE_DIR =
>>> os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
>>>   filename = 'Tree.jpg'
>>>   filepath = BASE_DIR + '//' + filename
>>>   images = Image.objects.all('filepath')
>>>   return render(request, "xyz.html", {'images': images})
>>>
>>> url.py
>>> path('Image_display/', views.Image_display, name="Image_display"),
>>>
>>> HTML page
>>> 
>>> 
>>> 
>>> 
>>>
>>> --
>>> 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/8da245ea-ea90-4730-83c0-accafc93b86bn%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/CAKPY9p%3DE1FmUc%3Dqqy1tGYBJbimFX873XXSTDndnn4kVUjo3ZWg%40mail.gmail.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/CAMyb2%3DheLgJo5dMxsCgQ8cm%3Dp0px5EHpLr2frYtDowV8mmC%2BbQ%40mail.gmail.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/CAKPY9p%3DOofwq7YrTp%3DWoKyO7mgxVovK2wN3-%3Dm9Ed2zTWZ%2BdAg%40mail.gmail.com
 
 .

>>> --
>>> You received this message because you are subscribed to the Google
>>> 

Re: how to Display images other than from static folder.

2022-01-31 Thread ramsha azhar
yes, I set check the attached settings.py file
 just want to know In template page how I set the path od
back directory folder where tree.png is placed.

On Mon, Jan 31, 2022 at 8:55 PM DJANGO DEVELOPER 
wrote:

> have you set up the static files in settings.py ?
>
> On Mon, Jan 31, 2022 at 8:49 PM ramsha azhar 
> wrote:
>
>> I just want to display the attached Tree.png image on the HTML page but
>> this image is created each time new according to the user input file. guide
>> me how to set the path of this mage on an HTML page or how to display this
>> tree.png as a user output image.
>>
>> On Mon, Jan 31, 2022 at 8:36 PM DJANGO DEVELOPER 
>> wrote:
>>
>>> tell me what you want to get as a result? do you want to display
>>> multiple images on HTML template?
>>>
>>> On Mon, Jan 31, 2022 at 8:27 PM ramsha azhar 
>>> wrote:
>>>
 So guide me the write way ...

 On Mon, 31 Jan 2022, 7:45 pm DJANGO DEVELOPER, 
 wrote:

> you are doing it the wrong way. totally the wrong way. I am not being
> rude.
>
> On Mon, Jan 31, 2022 at 7:42 PM ramsha azhar 
> wrote:
>
>> Gide me Django develpers. I just want to display my pictures that are
>> created each time new.
>> My mages are created in my project folder, not in the static folder.
>> how I display images on the HTML page by using the path of my project
>> folder.
>>
>> views.py
>>
>> def Image_display(request):
>>   BASE_DIR =
>> os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
>>   filename = 'Tree.jpg'
>>   filepath = BASE_DIR + '//' + filename
>>   images = Image.objects.all('filepath')
>>   return render(request, "xyz.html", {'images': images})
>>
>> url.py
>> path('Image_display/', views.Image_display, name="Image_display"),
>>
>> HTML page
>> 
>> 
>> 
>> 
>>
>> --
>> 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/8da245ea-ea90-4730-83c0-accafc93b86bn%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/CAKPY9p%3DE1FmUc%3Dqqy1tGYBJbimFX873XXSTDndnn4kVUjo3ZWg%40mail.gmail.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/CAMyb2%3DheLgJo5dMxsCgQ8cm%3Dp0px5EHpLr2frYtDowV8mmC%2BbQ%40mail.gmail.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/CAKPY9p%3DOofwq7YrTp%3DWoKyO7mgxVovK2wN3-%3Dm9Ed2zTWZ%2BdAg%40mail.gmail.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/CAMyb2%3Dh18EtBixgvyLF2wn-eLNA-uvwejxszEMeu9-kqyVL5xQ%40mail.gmail.com
>> 
>> .
>>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Django users" group.
> To unsubscribe from this topic, visit
> 

Re: how to Display images other than from static folder.

2022-01-31 Thread DJANGO DEVELOPER
have you set up the static files in settings.py ?

On Mon, Jan 31, 2022 at 8:49 PM ramsha azhar 
wrote:

> I just want to display the attached Tree.png image on the HTML page but
> this image is created each time new according to the user input file. guide
> me how to set the path of this mage on an HTML page or how to display this
> tree.png as a user output image.
>
> On Mon, Jan 31, 2022 at 8:36 PM DJANGO DEVELOPER 
> wrote:
>
>> tell me what you want to get as a result? do you want to display multiple
>> images on HTML template?
>>
>> On Mon, Jan 31, 2022 at 8:27 PM ramsha azhar 
>> wrote:
>>
>>> So guide me the write way ...
>>>
>>> On Mon, 31 Jan 2022, 7:45 pm DJANGO DEVELOPER, 
>>> wrote:
>>>
 you are doing it the wrong way. totally the wrong way. I am not being
 rude.

 On Mon, Jan 31, 2022 at 7:42 PM ramsha azhar 
 wrote:

> Gide me Django develpers. I just want to display my pictures that are
> created each time new.
> My mages are created in my project folder, not in the static folder.
> how I display images on the HTML page by using the path of my project
> folder.
>
> views.py
>
> def Image_display(request):
>   BASE_DIR =
> os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
>   filename = 'Tree.jpg'
>   filepath = BASE_DIR + '//' + filename
>   images = Image.objects.all('filepath')
>   return render(request, "xyz.html", {'images': images})
>
> url.py
> path('Image_display/', views.Image_display, name="Image_display"),
>
> HTML page
> 
> 
> 
> 
>
> --
> 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/8da245ea-ea90-4730-83c0-accafc93b86bn%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/CAKPY9p%3DE1FmUc%3Dqqy1tGYBJbimFX873XXSTDndnn4kVUjo3ZWg%40mail.gmail.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/CAMyb2%3DheLgJo5dMxsCgQ8cm%3Dp0px5EHpLr2frYtDowV8mmC%2BbQ%40mail.gmail.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/CAKPY9p%3DOofwq7YrTp%3DWoKyO7mgxVovK2wN3-%3Dm9Ed2zTWZ%2BdAg%40mail.gmail.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/CAMyb2%3Dh18EtBixgvyLF2wn-eLNA-uvwejxszEMeu9-kqyVL5xQ%40mail.gmail.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/CAKPY9pmoTLTnt_5i%3DNeWtRSSS1BjfyVZ%2BL%3DCSALwnOnZwu6zGw%40mail.gmail.com.


Re: how to Display images other than from static folder.

2022-01-31 Thread Ammar Mohammed
This topic solves your problem .

https://djangocentral.com/managing-media-files-in-django/

Ammar Mohammed
Tel: 0113075979
On 31 Jan 2022, 17:36 +0200, DJANGO DEVELOPER , wrote:
> tell me what you want to get as a result? do you want to display multiple 
> images on HTML template?
>
> On Mon, Jan 31, 2022 at 8:27 PM ramsha azhar  wrote:
> > So guide me the write way ...
> >
> > On Mon, 31 Jan 2022, 7:45 pm DJANGO DEVELOPER,  
> > wrote:
> > > you are doing it the wrong way. totally the wrong way. I am not being 
> > > rude.
> > >
> > > On Mon, Jan 31, 2022 at 7:42 PM ramsha azhar  
> > > wrote:
> > > > Gide me Django develpers. I just want to display my pictures that are 
> > > > created each time new.
> > > > My mages are created in my project folder, not in the static folder.
> > > > how I display images on the HTML page by using the path of my project 
> > > > folder.
> > > >
> > > > views.py
> > > >
> > > > def Image_display(request):
> > > >   BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
> > > >   filename = 'Tree.jpg'
> > > >   filepath = BASE_DIR + '//' + filename
> > > >   images = Image.objects.all('filepath')
> > > >   return render(request, "xyz.html", {'images': images})
> > > >
> > > > url.py
> > > > path('Image_display/', views.Image_display, name="Image_display"),
> > > >
> > > > HTML page
> > > > 
> > > > 
> > > > 
> > > > 
> > > >  --
> > > > 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/8da245ea-ea90-4730-83c0-accafc93b86bn%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/CAKPY9p%3DE1FmUc%3Dqqy1tGYBJbimFX873XXSTDndnn4kVUjo3ZWg%40mail.gmail.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/CAMyb2%3DheLgJo5dMxsCgQ8cm%3Dp0px5EHpLr2frYtDowV8mmC%2BbQ%40mail.gmail.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/CAKPY9p%3DOofwq7YrTp%3DWoKyO7mgxVovK2wN3-%3Dm9Ed2zTWZ%2BdAg%40mail.gmail.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/c0a72401-90b1-4900-b2b7-b5dee6ea0c9f%40Spark.


Re: how to Display images other than from static folder.

2022-01-31 Thread Lunga Baliwe
i think you want to use MEDIA_URL, see
https://learndjango.com/tutorials/django-file-and-image-uploads-tutorial
and also check https://docs.djangoproject.com/en/3.2/topics/files/ static
files are things like logos, css and maybe some javascript.

On Mon, Jan 31, 2022 at 5:36 PM DJANGO DEVELOPER 
wrote:

> tell me what you want to get as a result? do you want to display multiple
> images on HTML template?
>
> On Mon, Jan 31, 2022 at 8:27 PM ramsha azhar 
> wrote:
>
>> So guide me the write way ...
>>
>> On Mon, 31 Jan 2022, 7:45 pm DJANGO DEVELOPER, 
>> wrote:
>>
>>> you are doing it the wrong way. totally the wrong way. I am not being
>>> rude.
>>>
>>> On Mon, Jan 31, 2022 at 7:42 PM ramsha azhar 
>>> wrote:
>>>
 Gide me Django develpers. I just want to display my pictures that are
 created each time new.
 My mages are created in my project folder, not in the static folder.
 how I display images on the HTML page by using the path of my project
 folder.

 views.py

 def Image_display(request):
   BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
   filename = 'Tree.jpg'
   filepath = BASE_DIR + '//' + filename
   images = Image.objects.all('filepath')
   return render(request, "xyz.html", {'images': images})

 url.py
 path('Image_display/', views.Image_display, name="Image_display"),

 HTML page
 
 
 
 

 --
 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/8da245ea-ea90-4730-83c0-accafc93b86bn%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/CAKPY9p%3DE1FmUc%3Dqqy1tGYBJbimFX873XXSTDndnn4kVUjo3ZWg%40mail.gmail.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/CAMyb2%3DheLgJo5dMxsCgQ8cm%3Dp0px5EHpLr2frYtDowV8mmC%2BbQ%40mail.gmail.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/CAKPY9p%3DOofwq7YrTp%3DWoKyO7mgxVovK2wN3-%3Dm9Ed2zTWZ%2BdAg%40mail.gmail.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/CANDnEWee3Dp3B55RFDtwjmcNTz%2BNd%2BrGiufNfv%3DC7%2Bh6KeaYBQ%40mail.gmail.com.


Re: how to Display images other than from static folder.

2022-01-31 Thread DJANGO DEVELOPER
tell me what you want to get as a result? do you want to display multiple
images on HTML template?

On Mon, Jan 31, 2022 at 8:27 PM ramsha azhar 
wrote:

> So guide me the write way ...
>
> On Mon, 31 Jan 2022, 7:45 pm DJANGO DEVELOPER, 
> wrote:
>
>> you are doing it the wrong way. totally the wrong way. I am not being
>> rude.
>>
>> On Mon, Jan 31, 2022 at 7:42 PM ramsha azhar 
>> wrote:
>>
>>> Gide me Django develpers. I just want to display my pictures that are
>>> created each time new.
>>> My mages are created in my project folder, not in the static folder.
>>> how I display images on the HTML page by using the path of my project
>>> folder.
>>>
>>> views.py
>>>
>>> def Image_display(request):
>>>   BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
>>>   filename = 'Tree.jpg'
>>>   filepath = BASE_DIR + '//' + filename
>>>   images = Image.objects.all('filepath')
>>>   return render(request, "xyz.html", {'images': images})
>>>
>>> url.py
>>> path('Image_display/', views.Image_display, name="Image_display"),
>>>
>>> HTML page
>>> 
>>> 
>>> 
>>> 
>>>
>>> --
>>> 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/8da245ea-ea90-4730-83c0-accafc93b86bn%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/CAKPY9p%3DE1FmUc%3Dqqy1tGYBJbimFX873XXSTDndnn4kVUjo3ZWg%40mail.gmail.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/CAMyb2%3DheLgJo5dMxsCgQ8cm%3Dp0px5EHpLr2frYtDowV8mmC%2BbQ%40mail.gmail.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/CAKPY9p%3DOofwq7YrTp%3DWoKyO7mgxVovK2wN3-%3Dm9Ed2zTWZ%2BdAg%40mail.gmail.com.


Re: how to Display images other than from static folder.

2022-01-31 Thread ramsha azhar
So guide me the write way ...

On Mon, 31 Jan 2022, 7:45 pm DJANGO DEVELOPER, 
wrote:

> you are doing it the wrong way. totally the wrong way. I am not being rude.
>
> On Mon, Jan 31, 2022 at 7:42 PM ramsha azhar 
> wrote:
>
>> Gide me Django develpers. I just want to display my pictures that are
>> created each time new.
>> My mages are created in my project folder, not in the static folder.
>> how I display images on the HTML page by using the path of my project
>> folder.
>>
>> views.py
>>
>> def Image_display(request):
>>   BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
>>   filename = 'Tree.jpg'
>>   filepath = BASE_DIR + '//' + filename
>>   images = Image.objects.all('filepath')
>>   return render(request, "xyz.html", {'images': images})
>>
>> url.py
>> path('Image_display/', views.Image_display, name="Image_display"),
>>
>> HTML page
>> 
>> 
>> 
>> 
>>
>> --
>> 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/8da245ea-ea90-4730-83c0-accafc93b86bn%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/CAKPY9p%3DE1FmUc%3Dqqy1tGYBJbimFX873XXSTDndnn4kVUjo3ZWg%40mail.gmail.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/CAMyb2%3DheLgJo5dMxsCgQ8cm%3Dp0px5EHpLr2frYtDowV8mmC%2BbQ%40mail.gmail.com.


Re: how to Display images other than from static folder.

2022-01-31 Thread DJANGO DEVELOPER
you are doing it the wrong way. totally the wrong way. I am not being rude.

On Mon, Jan 31, 2022 at 7:42 PM ramsha azhar 
wrote:

> Gide me Django develpers. I just want to display my pictures that are
> created each time new.
> My mages are created in my project folder, not in the static folder.
> how I display images on the HTML page by using the path of my project
> folder.
>
> views.py
>
> def Image_display(request):
>   BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
>   filename = 'Tree.jpg'
>   filepath = BASE_DIR + '//' + filename
>   images = Image.objects.all('filepath')
>   return render(request, "xyz.html", {'images': images})
>
> url.py
> path('Image_display/', views.Image_display, name="Image_display"),
>
> HTML page
> 
> 
> 
> 
>
> --
> 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/8da245ea-ea90-4730-83c0-accafc93b86bn%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/CAKPY9p%3DE1FmUc%3Dqqy1tGYBJbimFX873XXSTDndnn4kVUjo3ZWg%40mail.gmail.com.


how to Display images other than from static folder.

2022-01-31 Thread ramsha azhar
Gide me Django develpers. I just want to display my pictures that are 
created each time new.
My mages are created in my project folder, not in the static folder.
how I display images on the HTML page by using the path of my project 
folder.

views.py

def Image_display(request):
  BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
  filename = 'Tree.jpg'
  filepath = BASE_DIR + '//' + filename
  images = Image.objects.all('filepath')
  return render(request, "xyz.html", {'images': images})

url.py
path('Image_display/', views.Image_display, name="Image_display"),

HTML page
 
 



-- 
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/8da245ea-ea90-4730-83c0-accafc93b86bn%40googlegroups.com.