INSTALLED_APPS = [
...
'dbmail',
]
DB_MAILER_SMS_PROVIDER = 'dbmail.providers.nexmo.sms'
NEXMO_USERNAME = 'My Api Key'
NEXMO_PASSWORD = 'My Api Password'
NEXMO_FROM = 'example.com'
NEXMO_LANG = 'en-us'
Вызываю функцию отправки смс:
from dbmail import send_db_sms
send_db_sms('sms-test', recipient)
В логах выскакивает ошибка и смс не отправляется:
Traceback (most recent call last):
File "/home/my-user/project/virtual/local/lib/python2.7/site-packages/dbmail/backends/mail.py", line 286, in send
self._send()
File "/home/my-user/project/virtual/local/lib/python2.7/site-packages/dbmail/backends/sms.py", line 36, in _send
phone, message, sms_from=self._from_email, **self._kwargs)
File "/home/my-user/project/virtual/local/lib/python2.7/site-packages/dbmail/providers/nexmo/sms.py", line 22, in send
'api_key': settings.NEXMO_USERNAME,
File "/home/my-user/project/virtual/local/lib/python2.7/site-packages/django/conf/__init__.py", line 57, in __getattr__
val = getattr(self._wrapped, name)
AttributeError: 'Settings' object has no attribute 'NEXMO_USERNAME'
В Shell:
>>>from django.conf import settings
>>>settings.NEXMO_USERNAME
>>>'My Api Key'
И как это можно понимать?