アプリでメールを送信できるようにモジュールをインストールしようとしているので、アプリhttps://github.com/bradwhittington/django-templated-emailにインストールしましたが、すべての指示に従っても、次のエラー メッセージが表示されます。
ImportError at /
cannot import name send_templated_mail
Request Method: GET
Request URL: http://127.0.0.1:8000/
Django Version: 1.4
Exception Type: ImportError
Exception Value:
cannot import name send_templated_mail
Exception Location: /Users/user/Dropbox/proyect/my-app/quizzer/views.py in <module>, line 32
Python Executable: /usr/bin/python
Python Version: 2.7.1
Python Path:
['/Users/user/Dropbox/proyect/my-app/quizzer/',
'/Library/Python/2.7/site-packages/pip-1.0-py2.7.egg',
'/Users/user/Dropbox/proyect/my-app/quizzer/quizzer/src/greatape/src',
'/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python27.zip',
'/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7',
'/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin',
'/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac',
'/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages',
'/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python',
'/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk',
'/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-old',
'/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload',
'/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC',
'/Library/Python/2.7/site-packages',
'/Library/Python/2.7/site-packages/setuptools-0.6c11-py2.7.egg-info']
何か案は?
編集:
from templated_email import send_templated_mail
send_templated_mail(
template_name='tempname',
from_email='******@gmail.com',
recipient_list=['****@gmail.com'],
context={
'username':u.username,
'date':datetime.date.today(),
},
)