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

  • SEARCH
  • Home
  • 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 7432081
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T09:24:00+00:00 2026-05-29T09:24:00+00:00

After many hours of hair pulling, I look to stackoverflow to help me solve

  • 0

After many hours of hair pulling, I look to stackoverflow to help me solve this issue.

I have create two signals to run auto-email functions. The signals are triggered via a modification of save_model in my admin.py file.

The only problem is…BOTH of the signals work when run through the Django development server (the auto-emails are sent), but only ONE of the signals work when testing on the remote server. I don’t understand how this is possible, and I haven’t been able to find the bug.

I know there isn’t much information to work with here. Any suggestions for what might be happening here?

As for file/directory structure, these signals are saved in a signals.py file located in the directory for this specific application. The signal is triggered via a modification of the save_model definition on my admin.py file, in the same directory.

Here are the signal definitions:

notify_status_change_signal = Signal(providing_args=['status', 'restaurant', 'delivery_date', 'contact_email', 'contact_phone'])
notify_on_change_signal = Signal(providing_args=['organization', 'identifier', 'id', 'restaurant', 'delivery_date'])

@receiver(notify_on_change_signal)
def notify_on_change(sender, organization, identifier, id, restaurant, delivery_date, signal, *args, **kwargs):
    "This is the signal that only functions when run through the local development server"
    order_id = identifier + str(id)
    subject = r'A change has been made to order %s' % order_id
    body = """
    System Message: The details for order %s (%s) have been updated by the client.""" % (order_id, organization)

    send_mail(subject, body, 'System Notification <system@expressdelivery.com>', [admin_email], fail_silently=False)    


@receiver(notify_status_change_signal)
def notify_status_change(sender, status, restaurant, delivery_date, contact_email, contact_phone, signal, *args, **kwargs):
    """This is the signal that works on both servers"""
    stat_body = {
    'Confirmed':"""

Message 1 """,

    'Placed': """

Message 2 """,

    'En Route': """

Message 3 """,

    'Completed':"""

Message 4 """,
    }

    #Auto email
    from_addr = 'Order Status <status@expressdelivery.com>'
    to_addrs = [contact_email]
    subject = u'Order %s %s status changed to %s.' % (restaurant, delivery_date, status)
    body = ''
    for stat_label, description in stat_body.iteritems():
        if status == stat_label: body = description

    if status == "Confirmed" or status == "En Route" or status == "Completed":    
        send_mail(subject, body, from_addr, to_addrs, fail_silently=False)

    #Auto text message
    if status == 'En Route':
        client = TwilioRestClient(settings.TWILIO_ACCOUNT_SID, settings.TWILIO_AUTH_TOKEN)
        message = client.sms.messages.create(to=contact_phone,
                                     from_="5555555555",
                                     body="Your order, %s %s, is now en route." % (restaurant, delivery_date))
  • 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-29T09:24:01+00:00Added an answer on May 29, 2026 at 9:24 am

    Although I definitely restarted the server when I updated the code with these signals, restarting the server again did the trick.

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

Sidebar

Related Questions

After many hours of googling and searching stackoverflow, I desperately need your help concerning
Still trying to solve this after many hours. The script works in jfiddle: http://jsfiddle.net/uCcYw/3/
im trying to customize this page indicator with half succes, but after many hours
After many hair-pulling frustrations I've finally got one version of the PerlMagick module working
After many hours, I have discovered that the given udp server needs the following
I am working on 2 problems for homework and after many hours I have
Trying to parse an nested expressions like GroupParser.parse({{a}{{c}{d}}}) After many hours i have now
After many hours of debugging and analysis, I have finally managed to isolate the
I have spent many hours looking into this and I still can't find a
after many hours and starting from similar layout that already worked I have almost

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.