Thursday, December 27, 2018

best way to generate PDFs in django - handling concurrency

we're building an app for the council where users fill in a form, then we generate a PDF (containing a page of text), and users get a download link on the homepage. 
we expect many users to submit forms concurrently.

I see 2 approaches:

1. Generate in the view as per documentation : https://docs.djangoproject.com/en/2.1/howto/outputting-pdf/
2. Use a seperate script to generate PDF and use django api https://www.django-rest-framework.org/api-guide/parsers/#fileuploadparser

However, to handle concurrency we'll also need a broker - like rabbitMQ + Celery

Is there a "best practice" way to approach this, or has anyone had experience with generating PDFs in django and can recommend an approach?

Thanks!!

resources:

https://realpython.com/asynchronous-tasks-with-django-and-celery/
https://simpleisbetterthancomplex.com/tutorial/2017/08/20/how-to-use-celery-with-django.html#why-should-i-use-celery


--
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+unsubscribe@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/9f06d9aa-7d89-4700-8cd0-9ae3343b3128%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment