0

The senior developer (and the only person experienced with Django in our company) has moved away and left us. Shortly after this (following his instructions) we pushed a site live onto a shared server (we have full control over the server) and updated the version of Django to the latest release for the new site to work.

Since then we have had issues with the other Django project on there which was built using an older version.

The main issue that I have is that we have a crontab that sends an email to the client outlining their orders. I have taken a screen grab of the error that I am getting but if I am honest I am struggling to make any sense of it. The names have been changed to protect the innocent (client).

http://i-am-a-fish.co.uk/help.png

I have uploaded a screen grab again i-am-a-fish.co.uk/help2.png

All suggestions are very welcomed!

5
  • 570 raise inst Does that help?
    – Shaun
    Dec 3, 2009 at 12:18
  • Well, you changed the names in the error trace but not in your window top name! Change it and put another image here if you really think his privacy is important!
    – GmonC
    Dec 3, 2009 at 12:20
  • @GmonC - done that thank you. Can anyone help please…
    – Shaun
    Dec 3, 2009 at 12:33
  • @Shaun - silly me, it says that in the image. How about the lines around it? Where are you referencing multipart_subtype? Dec 3, 2009 at 12:34
  • @Dominic Rodger I have uploaded a screen grab again i-am-a-fish.co.uk/help2.png
    – Shaun
    Dec 3, 2009 at 12:54

2 Answers 2

5

Deprecation warning is not the reason, you can ignore it (unless you want to fix and use hashlib). The reason is multipart_subtype which your custom EmailAlternativesMessage class is not defining. Try to find declaration of EmailAlternativesMessage and add

class EmailAlternativesMessage(EmailMessage):
  multipart_subtype = 'alternative'
  ...
2
  • You are an absolute live saver! That has worked a treat! Why has it worked? I think I need to do my homework ;-)
    – Shaun
    Dec 3, 2009 at 13:46
  • Glad that it did, but you must know that it is a quickfix, hard to do better without proper code inspection. There are many other mail multipart types, which you should use depending on what you are sending - you can read more about possible options at en.wikipedia.org/wiki/MIME#Multipart_messages
    – kibitzer
    Dec 3, 2009 at 14:12
3

Now that your immediate problem is fixed, the real solution here is to use virtualenv to isolate each project's dependencies (including Django itself) from the others, so deploying a project based on recent Django doesn't require an immediate upgrade of every other site on the server.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.