Re: Query Regarding Django Signals

2018-05-04 Thread jacob duyon
You can also just write a Celery task to do your async stuff and trigger it
from signals.py

On Fri, May 4, 2018 at 4:13 PM, Jani Tiainen  wrote:

> Hi,
>
> Signals are also good for decoupling things.
>
> For example you want to do some post save action for third party models.
>
> 4.5.2018 19.10 "Nipun Arora"  kirjoitti:
>
> Hello Community
>
> I was puzzled by the fact that if django signals are not asynchronous why
> do we use them as in when ever i want some trigger on post_save can't  i
> simply write that particular trigger in the same function that handles the
> request for saving a new object in django views..?
> as in :
>
>
> def handlerequest(Request):
> save instance to db
>Do the work i would do in the method handling the signal post_save
>
>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/5b64f4e4-afa2-485b-96a9-825b3c93b95e%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>
>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/CAHn91odCSN%3D1bUa46fckK4ositA38TpiuO30cQE
> sx%2B-pqZPqvg%40mail.gmail.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAJsZ3R5H%2BHjO9uOEYfsPXV1p6TmE9cvDgtq8ayMyVkc-xbDEqg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Need Help With integrating Python Scripts with Django Frame Work

2018-04-16 Thread jacob duyon
I'm not sure how many users you have for this, but it's best practice to
use an asynchronous task queue (like Celery) to run the actual powerpoint
creation code. If you simply run the script inside the view it will block
the response from happening. You create a celery task (which in your case
would have the powerpoint code), and the view will add the task to the
queue.

Celery requires a message broker, like RabbitMQ or Redis in order to use
it. They are both simple to setup and work well. The docs are pretty good
too.

On Mon, Apr 16, 2018 at 4:06 PM, Matthew Pava  wrote:

> Add a new view that returns the files.  Connect the “Download” button to
> the URL to that view.
>
> Your view should return an HttpResponse object.  For instance, I use this
> for the user to download PDF versions of forms:
>
>
>
> response = HttpResponse(pdf_contents, content_type='application/pdf')
> response['Content-Disposition'] = "%sfilename=%s" % ('attachment; ' if 
> download
> else '', filename)
> return response
>
>
>
> For pptx, your content_type would be:
>
> '.pptx': 
> 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
>
>
>
>
>
> *From:* django-users@googlegroups.com [mailto:django-users@
> googlegroups.com] *On Behalf Of *Balu Nanduri
> *Sent:* Monday, April 16, 2018 2:48 PM
> *To:* Django users
> *Subject:* Need Help With integrating Python Scripts with Django Frame
> Work
>
>
>
> Hi,
>
>  I am working on a project where I have to communicate with
> Tableau server and generate pptx with the images downloaded. I have a
> working script to do this piece, currently the script generates pptx and
> stores it to my local filesystem.
>
>
>
> Now I would like to create a web page which would accept necessary input
> from users and should trigger the script which generates pptx and then
> downloads the files to the user's browser.
>
>
>
> I had set up DJANGO environment of the same but not getting how to call
> this script from the web page so, could anyone help me out with a overview
> on how can I call my working script on click of a button and download the
> files generated by the script.
>
>
>
> Thanks & Regards
>
> Balu
>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/b5471890-0cd8-4ee7-a7c5-c43840590a4d%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/02eb6190ff484840b8729f146bb3e166%40ISS1.ISS.LOCAL
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAJsZ3R4qhfS8zHOHFrZkpWeags606hqoVeM-0qgHpbMM6%2BKrGw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: What were your best resources in learning programming, python, ultimately django?

2018-04-09 Thread jacob duyon
Do the class completely. Don't skip anything, especially things that are
hard. Always try to figure something out on your own, and take breaks when
you are completely stuck. If you are ever stuck, ask yourself why you are
stuck, and usually its because you don't understand some dependency. Google
everything about that thing until you fully understand that well. Then,
come back to the problem. Getting stuck and persevering are the fastest
ways to learn something, so don't be fearful of that process.

Tango with Django is the first interactive book I've read for Django. I
started by making some silly website I was interested in as quickly as I
could. Then, I went back and rebuilt it by writing tests for everything.
When you are prototyping to see how something works, don't bother with unit
tests. When you are prototyping you want to get an idea of how to design
the code. Just make sure to re-build it while writing unit tests.

Learning how to test things is the most important thing to learn early on.
When you write tests for your project, you are not only testing that the
thing works.. but also are writing documentation about how to use it.





On Mon, Apr 9, 2018 at 11:15 AM, Mateusz Kurowski <
kont...@mateuszkurowski.pl> wrote:

> https://www.youtube.com/watch?v=HTLu2DFOdTg=PLRVdut2KPAguz3xcd22i_o_
> onnmDKj3MA
> https://www.youtube.com/watch?v=7lmCu8wz8ro=
> PLOAwbpVBkzASOH-SzAq8NMI7H-Eo-Vql8
> https://www.youtube.com/watch?v=tkwZ1jG3XgA=
> PLOAwbpVBkzAQtFNxWpbeDAGRacBn6aL7t=7
> https://www.youtube.com/watch?v=Zo5q48BG8A4=8=
> PLOAwbpVBkzAQtFNxWpbeDAGRacBn6aL7t
>
>
> 2018-04-09 16:56 GMT+02:00 Amber Pond :
>
>> What were your best resources in learning programming, python, ultimately
>> django?
>>
>> Hi friends!
>>
>> Just starting out with some basic html and css knowledge, and I am taking
>> my first python class. When you were first learning programming, what were
>> you MOST influential and helpful resources? Reply to this thread so that
>> others and myself can use this for reference on our journeys.
>>
>> Sites?
>> Books?
>> Projects?
>> Forums?
>> Courses?
>>
>> --
>> 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 post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit https://groups.google.com/d/ms
>> gid/django-users/76a94793-11ad-4149-8b2f-2e9f42e3c77b%40googlegroups.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/CAO_JuYMMVB_EK_zDi_y4GAfjM08Nsxgyez5sPoTabnp2SySA
> Xg%40mail.gmail.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAJsZ3R4dzq2TabyN16vC21FuvELhTQuiBtrybGVOOC-16a1yRw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.