Hello guys,
I need to create a django application that takes a repository url, builds
the code located in the url location and runs a few tests. If the tests are
successfull, it tags the code and then sends an email to the user notifying
the same.
Because the building process takes a long time, I have used celery to run
it as a background process. I am implementing the following design.
def main_function(request):
# lines_of_code
result=tasks.BuildCodeAndVerify.delay(args)
#few more lines of code
return (request,'waiting_page.html',context)
Note: The waiting page has a progress bar that reads percentage progress
from my celery task i.e BuildCodeAndVerify.
*Now, I am facing two problems:*
1. If the build is successful, i need to redirect from the waiting page and
update the html view with a success page and a summary of the build. How do
i make the celery task redirect a webpage? Also, it needs to pass a
dictionary to the webpage containing a summary. How do i do all this?
2. Is it possible to pass the request object as an argument like
BuildCodeAndVerify(request,other_args). Because whenever I try i get an
error saying. "WSGI error: type object is not JSON serializable."
And I have very limited django and python knowledge so please go easy on me
if my questions look naive.
Would be grateful for any help and advice i can get.
Thanks a lot!
Khasim
--
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 [email protected].
To post to this group, send email to [email protected].
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/CABANScQFwPxUi7p2-ePTe5k9Sap5wGkABwSrtcCX50EbNZQpoQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.