Note that there are some explanatory texts on larger screens.

plurals
  1. POMy python app's email code will not update its template to a new version
    primarykey
    data
    text
    <p>I'm running a python 2.7 app in google app engine. I have a very basic function that sends a post to the taskqueue, which then posts to a function that constructs and sends an email based on a few variables parsed into a mail template. </p> <p>I'm not sure if the taskqueue is stuck on an old version of my app or what the problem is, but when I update the code in the file that sends the email, and upload the changes, those changes are not causing any the email text the app sends. It's like it's using a wrong older version of the file. </p> <p>What could be the cause of this issue?</p> <p><em>edit</em></p> <p>Just of note, this is what I've tried so far.</p> <ul> <li><p>I tried updating the app to a new version, but there was no change</p></li> <li><p>I tried editing other files in the project, and they all seem to update correctly</p></li> <li><p>I am using the oauth method for uploading with a .bat file to run the command, and there's no refreshing needed there because updating the app version didn't help</p></li> <li><p>I tried moving the email code that I want to use out of its old class, into a new class, changed the main.py url to point to the new class, and it still uses the old email text</p></li> <li><p>I tried <em>removing the old url for triggering the email</em> and using an entirely new url, and it <em>still</em> uses the old email text</p></li> <li><p>I tried testing the app using the version-number.project-id.appspot.com format, and it <em>still</em> uses the old email text, which doesn't exist anywhere in that version</p></li> </ul> <p>So to reiterate, I'm trying to send an email with my app, and even with the old message being totally removed, the email code being moved to a new file, and a new app version, somehow I'm still sending out the old email text. </p> <p><em>edit 2</em></p> <p>This is the relevant code for queuing the task:</p> <pre><code>taskqueue.add(url="/emailnotify", countdown = 1, params = {"email":tPaypalEmail, "gold":tGoldAmount, "name":tCustomerName, 'key':tOrderKey} ) </code></pre> <p>This is the relevant code in the class that's supposed to send the email:</p> <pre><code>from cStringIO import StringIO import webapp2 from models.order import Order from google.appengine.api import mail from google.appengine.ext import db, webapp from _stringmethods import StringMethods from _numbertogp import NumberToGp class EmailNotify(webapp2.RequestHandler): def post(self): tPaypalEmail = self.request.get('email') tCustomerName = self.request.get('name') tGoldAmount = self.request.get('gold') tOrderKey = self.request.get('key') tOrder = Order() tOrder = Order.get(tOrderKey) tVerificationCode = tOrder.orderVerificationCode tGoldInt = int(tGoldAmount) tGoldAmount = NumberToGp.ConvertIntToBet(tGoldInt) tVerificationFile = cStringIO.StringIO() tVerificationFile.write(str(tVerificationCode)) #new message which does not appear in the app emails tMessage = """Long string formatted message""" % (str(tCustomerName), str(tGoldAmount), str(tVerificationCode)) logging.debug(str(tMessage)) #this does not appear in the logs message = mail.EmailMessage() message.sender = "Smokin Mils Goldshop &lt;Smokin.Mils.Goldshop@gmail.com&gt;" #this email user is added as an app owner message.to = tPaypalEmail message.subject = "SmokinShop Order Details" message.body = tMessage message.attachments = [('verification-code.txt', tVerificationFile.getvalue())] message.send() </code></pre> <p><em>edit 3</em></p> <p>In response to <a href="http://www.reddit.com/r/learnpython/comments/1dcqln/my_python_apps_email_code_will_not_update_its/" rel="nofollow">the reddit question</a> where I posted this problem, here is the queue.yaml</p> <pre><code>queue: - name: default rate: 60/s bucket_size: 50 retry_parameters: min_backoff_seconds: 2 max_backoff_seconds: 200 task_retry_limit: 10 </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload