Re: Images are not showing up in the page

2023-04-09 Thread Sahan Srinivas
Yeah thanks everyone, the problem is resolved.

On Sun, Apr 9, 2023 at 5:19 PM Kiyavilo Msekwa  wrote:

> If you are running it on a live server make sure that media/photos folder
> is on public_html before you run load %satic% since the access to the
> domain will look into public_html folder to which Django does not run from.
>
> I had previously encountered similar situation and the solution was to
> copy the folder into public_html instead
>
> I hope this answer the question.
>
> Regards
>
> Kiyavilo
>
> On 9 Apr 2023, at 22:52, Sahan Srinivas <26sa...@gmail.com> wrote:
>
> Yeah I gave that, actually that is also not the problem. Not sure what it
> is
>
> Kind Regards,
> Sahan
>
> On Sun, Apr 9, 2023 at 3:44 PM Mir Junaid  wrote:
>
>> The command is {% load static%}
>>
>> On Sun, 9 Apr, 2023, 11:45 pm Sahan Srinivas, <26sa...@gmail.com> wrote:
>>
>>> Hi Devs,
>>>
>>> *Images are not showing up in Django. Below is the screenshot*
>>>
>>> 
>>> *Below are the screenshots of Settings.py file and urls.py files*
>>>
>>> *settings.py*
>>> 
>>>
>>> *urls.py*
>>> 
>>> *home.html:* (I have give like this in html file)
>>> 
>>> *views.py*
>>> 
>>> *Media Images:*
>>> 
>>>
>>> *I followed the documentation, stack overflow but, I am still not sure
>>> why images are not showing up. Can anyone help me out?*
>>>
>>> Kind regards,
>>> Sahan
>>>
>>>
>>> --
>>> 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/CAO3SeezAm3Lbe8JGxoCrZ2DCd74p8gFsxzUUoLa5166t6Dm9Kg%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/CAM%2BpT8z6w2Pjs6Hb_CxrOvoWSNhYe4SoL3RrTpkp7pHEXr2spg%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/CAO3SeeyoR-A%3DW7f0fC-NjLZcqyG-m4oMVoqonQ7r_XmAoaEEMg%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/FD4AD59E-9002-46D9-97AB-41DB5B9E4E3D%40gmail.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/CAO3SeewM5VGZGNn-ruSToDUPifu85MPLLd5nCeDfw7SSNuNTFg%40mail.gmail.com.


Re: Images are not showing up in the page

2023-04-09 Thread Kiyavilo Msekwa
If you are running it on a live server make sure that media/photos folder is on 
public_html before you run load %satic% since the access to the domain will 
look into public_html folder to which Django does not run from.

I had previously encountered similar situation and the solution was to copy the 
folder into public_html instead

I hope this answer the question.

Regards

Kiyavilo

> On 9 Apr 2023, at 22:52, Sahan Srinivas <26sa...@gmail.com> wrote:
> 
> Yeah I gave that, actually that is also not the problem. Not sure what it is
> 
> Kind Regards,
> Sahan
> 
> On Sun, Apr 9, 2023 at 3:44 PM Mir Junaid  > wrote:
> The command is {% load static%}
> 
> On Sun, 9 Apr, 2023, 11:45 pm Sahan Srinivas, <26sa...@gmail.com 
> > wrote:
> Hi Devs,
> 
> Images are not showing up in Django. Below is the screenshot
> 
> 
> Below are the screenshots of Settings.py file and urls.py files
> 
> settings.py
> 
> 
> urls.py
> 
> home.html: (I have give like this in html file)
> 
> views.py
> 
> Media Images:
> 
> 
> I followed the documentation, stack overflow but, I am still not sure why 
> images are not showing up. Can anyone help me out?
> 
> Kind regards,
> Sahan
> 
> 
> -- 
> 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/CAO3SeezAm3Lbe8JGxoCrZ2DCd74p8gFsxzUUoLa5166t6Dm9Kg%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/CAM%2BpT8z6w2Pjs6Hb_CxrOvoWSNhYe4SoL3RrTpkp7pHEXr2spg%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/CAO3SeeyoR-A%3DW7f0fC-NjLZcqyG-m4oMVoqonQ7r_XmAoaEEMg%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/FD4AD59E-9002-46D9-97AB-41DB5B9E4E3D%40gmail.com.


Re: Scheduler with Django on Windows platform

2023-04-09 Thread Harsh Vyas

Try,
Django  Q

On Tuesday, 28 March 2023 at 14:57:50 UTC+5:30 Robbi Nespu wrote:

> Hi Django developers,
> I am looking for any package that can do scheduler job. I am used with 
> "Django-crontab" but I can't use it on windows platform.
>
> Do you guys have any suggestion?
>
> -- 
> Regards
> Robbi Nespu
>
> PGP: D311 B5FF EEE6 0BE8 9C91 FA9E 0C81 FA30 3B3A 80BA
>

-- 
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/31b260f8-80fb-4309-a012-43a7ae3fa1b4n%40googlegroups.com.


Re: Using one query set for another query

2023-04-09 Thread Harsh Vyas
Hi,
Need a slight justification on your case what exactly is the use case you 
need to resolve.
So far, I understood you need to know details about unpaid bills, 

Approach 1:- 
Model bill_payment_history will have data for field date_paid in case of 
only paid bills, so you can try 
to query something like

queryset= bill_payment_history.objects.filter(date_paid= None)

Approach 2:- 
You can annotate a field on all known_bills object using case statement for
 which different between current date and excepted_due_date is already 
breached.

For annotate and case refer to below docs:-
https://docs.djangoproject.com/en/4.2/ref/models/conditional-expressions/

Hope this solve your use case

On Wednesday, 29 March 2023 at 07:26:58 UTC+5:30 lone...@gmail.com wrote:

> Hello all,
>
> I am trying to use the query of:
> paid_bills = bill_payment_history.objects.filter(date_paid__year='2023', 
> date_paid__month='03')
>
> as criteria for another query to only show the unpaid bills.
>
> The known_bills model is my control list of known bills that occur 
> frequently.
> The  bill_payment_history model is my bill transaction table.  It is a 
> running history of transactions for bill payment.
>
> A sample of known_bills records is:
> bill_1
> bill_2
> bill_3
>
> A sample of  bill_payment_history is:
> bill_1 paid last month
> bill_2 paid last month
> bill_3 paid last month
> bill_1 paid this month
> bill_2 paid this month
> bill_3 paid this month
>
> What I am trying to do is use bill_payment_history filtered on date_paid 
> by year and month and query the known_bills table to see what bills have 
> not been paid yet.  I keep trying something similar to:  results = 
> paid_bills.exclude(short_description__in=known_bills)
>
> but my results either keep coming up with all of the records or none of 
> them.  What am I doing wrong?
>
> Here is the model information:
>
> class known_bills(models.Model):
> #Full bank transaction
> description = models.CharField(max_length=255)
> #String value to search the CSV file with.
> short_description = models.CharField(max_length=255, unique=True)
> #Value I know it as.
> friendly_name = models.CharField(max_length=255)
> expected_due_date = models.DateField()
> expected_cost = models.DecimalField(max_digits=6,decimal_places=2)
>
> class bill_payment_history(models.Model):
> description = models.CharField(max_length=255)
> short_description = models.ForeignKey(known_bills, 
> on_delete=models.CASCADE)
> friendly_name = models.CharField(max_length=255)
> date_paid = models.DateField()
> cost = models.DecimalField(max_digits=6,decimal_places=2)
>
> class Meta:
> unique_together = (
> ('short_description',
> 'date_paid'),
> )
>

-- 
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/066fd675-7a0a-4ed0-834e-2f44c6786ecan%40googlegroups.com.