Re: Randomly Generate a "Certificate of Completion"

2020-10-22 Thread Derek
You'd need to have a profile for each user, so you can track if they reach 
the URL (true/false) and then use their email or internal ID or a generated 
UUID for the certificate (you could store this extra code as well if 
needed).

For generating a certificate, I'd use a PDF format; this would create a 
downloadable file they could share themselves on other platforms:
https://assist-software.net/blog/how-create-pdf-files-python-django-application-using-reportlab

Alternatively, generate a PNG image which can also be downloaded or shared 
( https://code-maven.com/create-images-with-python-pil-pillow ) - this 
could also be displayed along with their other profile info.

On Wednesday, 21 October 2020 at 17:26:16 UTC+2 Lightning Bit wrote:

> Hi All, 
>
> Where should one start to randomly generate a "Certificate of Completion" 
> with the user's name, a certificate ID, and certificate title? I want for 
> this certificate to appear upon the user making it to a specific URL and 
> for the certificate to have a special ID for each user. 
>
> Also, how would one be able to make these certificates shareable on social 
> media platforms?
>
> Thanks all, I hope that someone can help with this Django predicament.
>

-- 
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/4264068c-54b4-4b74-8c0d-f64dda24cc55n%40googlegroups.com.


Learning django

2020-10-22 Thread Daren adams
Hi here, for those of you looking for resouces to learn django,  you can 
check these telegram channels for leaning ressources.

https://t.me/djangonautees
https://t.me/joinchat/AFg8fQgHoBk5uPMCvQ


-- 
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/31b2d72e-9928-4676-85fb-04065f67e76en%40googlegroups.com.


Django-does-not-call-get-prep-value-while-using-lookups

2020-10-22 Thread Shahprogrammer
I have an custom model field in which i have implemented cryptography. I 
get prefect results when I don't use lookups for filtering data i.e. it 
calls *get_prep_value()* But when I filter data using lookups like 
*startswith* or *endswith*. it does not calls get_prep_value().How to solve 
this problem?

-- 
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/1e88e279-96f5-471d-9c6b-1f1be212276an%40googlegroups.com.


Process Data during server initialization

2020-10-22 Thread Lois Greene-Hernandez
Hello, 

I'm working on a data and calculation intensive django application.  It 
uses pandas and plotly.py to create many charts and graphs.  I have some 
control over the design of the application but not total control.  One 
decision that I stuck with is that all charts and graphs are preprocessed 
on the first page that loads.  If it were up to me, I'd process what is 
needed at the time but its not up to me.  

Since I need to load and process a lot of data prior to page load, I was 
wondering if it would be possible to do this during server start up.  I'd 
also need to pass a log of data from whatever startup process I ran to the 
django views.  

Any information that you could shed on this problem would be greatly 
appreciated. 

Thanks

Lois J. Greene-Hernandez 

-- 
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/5e34166f-ade9-4dec-bb9d-0a8d6392fdc8n%40googlegroups.com.


Re: Process Data during server initialization

2020-10-22 Thread Scott Sawyer
Could you run a cron job on the system to analyze the data periodically?

Sent from my iPhone

> On Oct 22, 2020, at 1:30 PM, Lois Greene-Hernandez  wrote:
> 
> Hello, 
> 
> I'm working on a data and calculation intensive django application.  It uses 
> pandas and plotly.py to create many charts and graphs.  I have some control 
> over the design of the application but not total control.  One decision that 
> I stuck with is that all charts and graphs are preprocessed on the first page 
> that loads.  If it were up to me, I'd process what is needed at the time but 
> its not up to me.  
> 
> Since I need to load and process a lot of data prior to page load, I was 
> wondering if it would be possible to do this during server start up.  I'd 
> also need to pass a log of data from whatever startup process I ran to the 
> django views.  
> 
> Any information that you could shed on this problem would be greatly 
> appreciated. 
> 
> Thanks
> 
> Lois J. Greene-Hernandez 
> -- 
> 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/5e34166f-ade9-4dec-bb9d-0a8d6392fdc8n%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/F90610CE-721D-4FEB-8992-FAF63A6C6368%40gmail.com.


Re: Process Data during server initialization

2020-10-22 Thread Lois Greene-Hernandez
Well it's data that I need to populate the pages.  It's very processor
intensive and I'll need to pass it back to the views once it's processed.
Can I pass data back to the views once I've run a task?  I'm looking into
caching alternatives.

Thanks
Lois

On Thu, Oct 22, 2020 at 4:55 PM Scott Sawyer  wrote:

> Could you run a cron job on the system to analyze the data periodically?
>
> Sent from my iPhone
>
> On Oct 22, 2020, at 1:30 PM, Lois Greene-Hernandez 
> wrote:
>
> Hello,
>
> I'm working on a data and calculation intensive django application.  It
> uses pandas and plotly.py to create many charts and graphs.  I have some
> control over the design of the application but not total control.  One
> decision that I stuck with is that all charts and graphs are preprocessed
> on the first page that loads.  If it were up to me, I'd process what is
> needed at the time but its not up to me.
>
> Since I need to load and process a lot of data prior to page load, I was
> wondering if it would be possible to do this during server start up.  I'd
> also need to pass a log of data from whatever startup process I ran to the
> django views.
>
> Any information that you could shed on this problem would be greatly
> appreciated.
>
> Thanks
>
> Lois J. Greene-Hernandez
>
> --
> 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/5e34166f-ade9-4dec-bb9d-0a8d6392fdc8n%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/X1joo7QEbnc/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/F90610CE-721D-4FEB-8992-FAF63A6C6368%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/CAAGmcw0tk9fd%3DhjvpdZTpqqf9-gDDKgtW7YYfvJxVcCo1DvD4g%40mail.gmail.com.


Avoiding duplicate on_commit actions

2020-10-22 Thread Steve Jorgensen
Hi all,

If a record is updated more than once in a transaction causing something to 
need to happen on commit, but don't want to suffer the performance cost of 
unnecessarily doing that post-commit activity multiple times, is there any 
clean way to de-duplicate that?

If on_commit has an optional key argument to have it replace any entry with 
the same key rather than adding it again, that would solve this problem 
nicely. Of course, on_commit does not appear to have anything like that.

-- 
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/4b4e3544-3e50-4c10-bc68-2b31a73069b0n%40googlegroups.com.


Re: Process Data during server initialization

2020-10-22 Thread Okware Aldo
Hi Lois,

To expand on what Scott is saying.
- model DB tables to store the data you need to render the graphs
- build a service to preprocess the data - this service can run
periodically depending on how up to date you need the graphs to be (a
microservice)
- build a single endpoint to simple fetch the data the graphs need (Django)
if this is a monolith the normal Django views should do the trick






On Fri, Oct 23, 2020 at 12:01 AM Lois Greene-Hernandez 
wrote:

> Well it's data that I need to populate the pages.  It's very processor
> intensive and I'll need to pass it back to the views once it's processed.
> Can I pass data back to the views once I've run a task?  I'm looking into
> caching alternatives.
>
> Thanks
> Lois
>
> On Thu, Oct 22, 2020 at 4:55 PM Scott Sawyer  wrote:
>
>> Could you run a cron job on the system to analyze the data periodically?
>>
>> Sent from my iPhone
>>
>> On Oct 22, 2020, at 1:30 PM, Lois Greene-Hernandez 
>> wrote:
>>
>> Hello,
>>
>> I'm working on a data and calculation intensive django application.  It
>> uses pandas and plotly.py to create many charts and graphs.  I have some
>> control over the design of the application but not total control.  One
>> decision that I stuck with is that all charts and graphs are preprocessed
>> on the first page that loads.  If it were up to me, I'd process what is
>> needed at the time but its not up to me.
>>
>> Since I need to load and process a lot of data prior to page load, I was
>> wondering if it would be possible to do this during server start up.  I'd
>> also need to pass a log of data from whatever startup process I ran to the
>> django views.
>>
>> Any information that you could shed on this problem would be greatly
>> appreciated.
>>
>> Thanks
>>
>> Lois J. Greene-Hernandez
>>
>> --
>> 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/5e34166f-ade9-4dec-bb9d-0a8d6392fdc8n%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/X1joo7QEbnc/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/F90610CE-721D-4FEB-8992-FAF63A6C6368%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/CAAGmcw0tk9fd%3DhjvpdZTpqqf9-gDDKgtW7YYfvJxVcCo1DvD4g%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/CAMEZma-P3Z6yoAJJGCWbDpd8YEWkc_kV8uS4FKDNvsR-LF-4WA%40mail.gmail.com.


Scaling dumpdata and loaddata

2020-10-22 Thread Dan Davis
dumpdata and loaddata work for me on some smaller applications, but I am 
wondering whether any of you have strategies to scale it up to more data.  
My DevOps doesn't really give developers access to much - not even RDS 
snapshots.  The larger applications have written some logic to move data, 
but maybe there is a solution.

-- 
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/2a8dc211-d9b6-4e27-8593-e2ba17343a69n%40googlegroups.com.


Re: Scaling dumpdata and loaddata

2020-10-22 Thread Dan Davis
I have found an answer of sorts in a previous thread.  Fred says:

> Just for the follow-up, I ended up using pgloader and after some argument 
tweaking, it worked. Cheers.
On Thursday, October 22, 2020 at 6:48:57 PM UTC-4 Dan Davis wrote:

> dumpdata and loaddata work for me on some smaller applications, but I am 
> wondering whether any of you have strategies to scale it up to more data.  
> My DevOps doesn't really give developers access to much - not even RDS 
> snapshots.  The larger applications have written some logic to move data, 
> but maybe there is a solution.

-- 
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/f5642d06-93b9-4eba-a251-eec7a7d038adn%40googlegroups.com.


Re: Process Data during server initialization

2020-10-22 Thread Shaheed Haque
Well, it's a bit of a blunt weapon, but Python is going to run any code it
finds at module scope as the process is initialised. So you could cause
your heavy stuff to be run there? Or at least spawned from there?

On Thu, 22 Oct 2020, 22:59 Okware Aldo,  wrote:

> Hi Lois,
>
> To expand on what Scott is saying.
> - model DB tables to store the data you need to render the graphs
> - build a service to preprocess the data - this service can run
> periodically depending on how up to date you need the graphs to be (a
> microservice)
> - build a single endpoint to simple fetch the data the graphs need
> (Django) if this is a monolith the normal Django views should do the trick
>
>
>
>
>
>
> On Fri, Oct 23, 2020 at 12:01 AM Lois Greene-Hernandez 
> wrote:
>
>> Well it's data that I need to populate the pages.  It's very processor
>> intensive and I'll need to pass it back to the views once it's processed.
>> Can I pass data back to the views once I've run a task?  I'm looking into
>> caching alternatives.
>>
>> Thanks
>> Lois
>>
>> On Thu, Oct 22, 2020 at 4:55 PM Scott Sawyer  wrote:
>>
>>> Could you run a cron job on the system to analyze the data periodically?
>>>
>>> Sent from my iPhone
>>>
>>> On Oct 22, 2020, at 1:30 PM, Lois Greene-Hernandez 
>>> wrote:
>>>
>>> Hello,
>>>
>>> I'm working on a data and calculation intensive django application.  It
>>> uses pandas and plotly.py to create many charts and graphs.  I have some
>>> control over the design of the application but not total control.  One
>>> decision that I stuck with is that all charts and graphs are preprocessed
>>> on the first page that loads.  If it were up to me, I'd process what is
>>> needed at the time but its not up to me.
>>>
>>> Since I need to load and process a lot of data prior to page load, I was
>>> wondering if it would be possible to do this during server start up.  I'd
>>> also need to pass a log of data from whatever startup process I ran to the
>>> django views.
>>>
>>> Any information that you could shed on this problem would be greatly
>>> appreciated.
>>>
>>> Thanks
>>>
>>> Lois J. Greene-Hernandez
>>>
>>> --
>>> 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/5e34166f-ade9-4dec-bb9d-0a8d6392fdc8n%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/X1joo7QEbnc/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/F90610CE-721D-4FEB-8992-FAF63A6C6368%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/CAAGmcw0tk9fd%3DhjvpdZTpqqf9-gDDKgtW7YYfvJxVcCo1DvD4g%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/CAMEZma-P3Z6yoAJJGCWbDpd8YEWkc_kV8uS4FKDNvsR-LF-4WA%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/CAHAc2jdi4d_Rz4X4Kue-CbB%2B88-EQyD5dcXqxSysKvBB9hFXFA%40mail.gmail.com.


Re: Randomly Generate a "Certificate of Completion"

2020-10-22 Thread King Niko
This is perfect. Thank you Derek!

On Thu, Oct 22, 2020 at 9:14 AM Derek  wrote:

> You'd need to have a profile for each user, so you can track if they reach
> the URL (true/false) and then use their email or internal ID or a generated
> UUID for the certificate (you could store this extra code as well if
> needed).
>
> For generating a certificate, I'd use a PDF format; this would create a
> downloadable file they could share themselves on other platforms:
>
> https://assist-software.net/blog/how-create-pdf-files-python-django-application-using-reportlab
>
> Alternatively, generate a PNG image which can also be downloaded or shared
> ( https://code-maven.com/create-images-with-python-pil-pillow ) - this
> could also be displayed along with their other profile info.
>
> On Wednesday, 21 October 2020 at 17:26:16 UTC+2 Lightning Bit wrote:
>
>> Hi All,
>>
>> Where should one start to randomly generate a "Certificate of Completion"
>> with the user's name, a certificate ID, and certificate title? I want for
>> this certificate to appear upon the user making it to a specific URL and
>> for the certificate to have a special ID for each user.
>>
>> Also, how would one be able to make these certificates shareable on
>> social media platforms?
>>
>> Thanks all, I hope that someone can help with this Django predicament.
>>
> --
> 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/4264068c-54b4-4b74-8c0d-f64dda24cc55n%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/CAO1EWpGOZ3yzD5qOKydMXb%2BrGq_KvZVJeB0B0sBB3vEkPdJR4w%40mail.gmail.com.