Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3693850
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T04:25:34+00:00 2026-05-19T04:25:34+00:00

I’m using the django_notification module. https://github.com/pinax/django-notification/blob/master/docs/usage.txt This is what I do in my code

  • 0

I’m using the django_notification module. https://github.com/pinax/django-notification/blob/master/docs/usage.txt

This is what I do in my code to send an email to a user when something happens:

notification.send([to_user], "comment_received", noti_dict)

But, this seems to block the request. And it takes a long time to send it out. I read the docs and it says that it’s possible to add it to a queue (asynchronous). How do I add it to an asynchronous queue?

I don’t understand what the docs are trying to say. What is “emit_notices”? When do I call that? Do I have a script that calls that every 5 seconds? That’s silly. What’s the right way to do it asynchronously? What do I do?

Lets first break down what each does.

``send_now``
~~~~~~~~~~~~

This is a blocking call that will check each user for elgibility of the
notice and actually peform the send.

``queue``
~~~~~~~~~

This is a non-blocking call that will queue the call to ``send_now`` to
be executed at a later time. To later execute the call you need to use
the ``emit_notices`` management command.

``send``
~~~~~~~~

A proxy around ``send_now`` and ``queue``. It gets its behavior from a global
setting named ``NOTIFICATION_QUEUE_ALL``. By default it is ``False``. This
setting is meant to help control whether you want to queue any call to
``send``.

``send`` also accepts ``now`` and ``queue`` keyword arguments. By default
each option is set to ``False`` to honor the global setting which is ``False``.
This enables you to override on a per call basis whether it should call
``send_now`` or ``queue``.
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T04:25:34+00:00Added an answer on May 19, 2026 at 4:25 am

    It looks like in your settings file you need to set

    NOTIFICATION_QUEUE_ALL=True
    

    And then you need to setup a cronjob (maybe every 10-30 seconds or something) to run something like,

    django_admin.py emit_notices
    

    This will periodically run and do the blocking call which sends out all the emails and whatever legwork the notification app needs. I’m sure if there is nothing to do it’s not that intense of a workload.

    And before you expand on your comment about this being silly you should think about it. It’s not really silly at all. You don’t want a blocking call to be tied to a web request otherwise the user will never get a response back from the server. Sending email is blocking in this sense.

    Now, if you were just going to have the person receive this notification when they login, then you probably don’t need to go this way because you do have to make an external call to sendmail or whatever you’re using to send emails. But in your case, sending emails, you should do it this way.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I'm making a simple page using Google Maps API 3. My first. One marker
We're building an app, our first using Rails 3, and we're having to build
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
In order to apply a triggered animation to all ToolTip s in my app,
I want use html5's new tag to play a wav file (currently only supported
I want to count how many characters a certain string has in PHP, but
Is it possible to replace javascript w/ HTML if JavaScript is not enabled on

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.