Search code examples
pythondjangodjango-mailer

django-mailer error whent trying to send mail


I have followed the installation steps provided by the repository provider of django-mailer

but when I try the ./manage.py test mailer command

or ./manage.py send_mail command

I receive this error:

from six.moves.urllib.parse import quote
ImportError: No module named urllib.parse

I receive this error on both my development machine and the production server.

On both I run Python 2.6

I already asked under issues tracker of django-mailer but there was no reply. As I really need to implement this sort of functionality in a few days on a project, this is my last atempt to use this otherwise I will have to come up with another solution.

Any suggestions would be very appreciated.

BR


Solution

  • I think your six version is equal or less than 1.3.0:

    In [1]: import six
    In [2]: six.__version__
    Out[2]: '1.3.0'
    In [3]: from six.moves.urllib.parse import quote
    ---------------------------------------------------------------------------
    ImportError                               Traceback (most recent call last)
    <ipython-input-3-4680c55c65e8> in <module>()
    ----> 1 from six.moves.urllib.parse import quote
    
    ImportError: No module named urllib.parse
    

    try to upgrade six by:

    pip install six --upgrade
    

    Then import of quote is ok:

    In [1]: import six
    
    In [2]: six.__version__
    Out[2]: '1.5.2'
    
    In [3]: from six.moves.urllib.parse import quote