Re: QuerySet performance on large datasets

2021-02-12 Thread Peter of the Norse
bool(qs) is recommended when the queryset has already been run.  If you do 
something like 

val = qs.earliest(some_property) if bool(qs) else None

then there isn’t a performance gain because it still has to run qs.exists() to 
even see if there is a value.  Later things like that will be cached though.

Although I might be wrong about this.  I have not dug enough to be certain.

> On Jan 12, 2021, at 4:10 AM, 'Juergen H' via Django users 
>  wrote:
> 
> Dear django users,
> 
> when working on very large datasets (millions of items) and performing 
> queries on it, I have a few questions regaring the performance.
> 
> From my understanding using `bool(qs)` is preferred over using `qs.exists()` 
> when the queryset is used later on, as `bool(qs)` already evaluates and 
> caches the qs, which `qs.exists()` does not. Is that correct?
> 
> Is the above assumption also true, when the qs that has bee evaluated by 
> using `bool(qs)` afterwards is accessed by e.g. 
> `qs.earliest(some_property)`,? 
> Or does `qs.earliest(some_property)` generate a new qs and hence there is not 
> really an advantage of having the original qs already evaluated by `bool(qs)`?
> 
> E.g. using `.filter()` will surely create and return a new qs, as stated in 
> the docu and in this case I am pretty sure, the advantage of evaluating and 
> caching the qs by using `bool(qs)` is lost here.
> But for `earliest()` or `latest()` the docu only states, that an object is 
> returned. It does not say anything about a new queryset being created.
> Hence my questions..
> 
> Thanks a lot and happy coding
> Juergen
> 
> -- 
> 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/571d5cb6-bd53-4db4-aad1-2a820d71782en%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/A7EACE25-ABE9-44CA-8BAB-65E7953B5B71%40gmail.com.


Re: IS it possible to debug Django with Apache and mod_wsgi

2021-02-12 Thread Ognjen Bjelica
Hi Rob,
Thanks for the quick reply, but I was looking for a way to run code line by
line. Because DEBUG=True is useful only in some situations.


On Fri, Feb 12, 2021, 17:19 Rob Wilkinson 
wrote:

> Sorry meant DEBUG=True   :)
>
> On Fri, Feb 12, 2021 at 10:39 AM Rob Wilkinson 
> wrote:
>
>>
>> DEBUG=Yes in settings.py shows what you need even in Apache
>>
>> Don’t run like that in prod!
>>
>>
>> On Fri, Feb 12, 2021 at 10:36 AM Ognjen B. 
>> wrote:
>>
>>> Hi everyone,
>>> I was wondering can anyone point me to a document describing how to
>>> setup debugging using any IDE (VS Code, PyCharm, etc) or at least from
>>> console when using Django with Apache and mod_wsgi? Or if it's not possible
>>> please let me know so I don't waste any more time.
>>>
>>> Thanks
>>>
>>> --
>>> 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/4ccfa917-06b4-4182-a76d-7b1a4c41eff5n%40googlegroups.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
> https://groups.google.com/d/topic/django-users/XXq-_CJwSh4/unsubscribe.
> To unsubscribe from this group and all its topics, 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/CAAdSEeZLJLMSUBHAgNaBG4CZYF%2B%3D1tcqTPDYAr06-jJvBRSOmA%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/CAOW%2BycFVYZw0uCwPNrLz93sUCMthP-2cp1CrtPe7YqhiYAomMA%40mail.gmail.com.


Re: IS it possible to debug Django with Apache and mod_wsgi

2021-02-12 Thread Rob Wilkinson
DEBUG=Yes in settings.py shows what you need even in Apache

Don’t run like that in prod!


On Fri, Feb 12, 2021 at 10:36 AM Ognjen B.  wrote:

> Hi everyone,
> I was wondering can anyone point me to a document describing how to setup
> debugging using any IDE (VS Code, PyCharm, etc) or at least from console
> when using Django with Apache and mod_wsgi? Or if it's not possible please
> let me know so I don't waste any more time.
>
> Thanks
>
> --
> 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/4ccfa917-06b4-4182-a76d-7b1a4c41eff5n%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/CAAdSEeYk4R9xSRuMfnB%2B1PfY46gmJoyeGgG8CNz6WvL-skKo%2BA%40mail.gmail.com.


Re: IS it possible to debug Django with Apache and mod_wsgi

2021-02-12 Thread Rob Wilkinson
Sorry meant DEBUG=True   :)

On Fri, Feb 12, 2021 at 10:39 AM Rob Wilkinson 
wrote:

>
> DEBUG=Yes in settings.py shows what you need even in Apache
>
> Don’t run like that in prod!
>
>
> On Fri, Feb 12, 2021 at 10:36 AM Ognjen B. 
> wrote:
>
>> Hi everyone,
>> I was wondering can anyone point me to a document describing how to setup
>> debugging using any IDE (VS Code, PyCharm, etc) or at least from console
>> when using Django with Apache and mod_wsgi? Or if it's not possible please
>> let me know so I don't waste any more time.
>>
>> Thanks
>>
>> --
>> 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/4ccfa917-06b4-4182-a76d-7b1a4c41eff5n%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/CAAdSEeZLJLMSUBHAgNaBG4CZYF%2B%3D1tcqTPDYAr06-jJvBRSOmA%40mail.gmail.com.


IS it possible to debug Django with Apache and mod_wsgi

2021-02-12 Thread Ognjen B.
Hi everyone,
I was wondering can anyone point me to a document describing how to setup 
debugging using any IDE (VS Code, PyCharm, etc) or at least from console 
when using Django with Apache and mod_wsgi? Or if it's not possible please 
let me know so I don't waste any more time.

Thanks

-- 
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/4ccfa917-06b4-4182-a76d-7b1a4c41eff5n%40googlegroups.com.


Re: Payments

2021-02-12 Thread o1bigtenor
On Thu, Feb 11, 2021 at 10:59 PM MUGOYA DIHFAHSIH  wrote:
>
> idealy i want to use visa, ineed help on how to integrate it into the payment 
> module. Thanks... but MPESA is from mobile phone to another phone 
> transaction(mobile money).
>
Makes sense - - - - likely a very regional product/service.

Thank you

-- 
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/CAPpdf59T-knNob7QxYzQ7Y_FuCQrKQzevG66L%3DPcbsAWUJz7eQ%40mail.gmail.com.


Re: Upload images

2021-02-12 Thread Kasper Laudrup

On 12/02/2021 05.12, mtp...@gmail.com wrote:
How do I check if the files are valid images or not before creating the 
organization object.




When asking someone for help, at least have the courtesy to reply the 
suggestions you're given before asking an unrelated question.


This will greatly improve the chances of getting help from someone.

Kind regards,

Kasper Laudrup

--
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/f760733a-5126-efaa-612e-d7c53960c9f0%40stacktrace.dk.