Answer the question
In order to leave comments, you need to log in
Django: 'Settings' object has no attribute 'NEXMO_USERNAME'?
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'
>>>from django.conf import settings
>>>settings.NEXMO_USERNAME
>>>'My Api Key'
Answer the question
In order to leave comments, you need to log in
Most likely, you have several settings: default, local, stage, staging, production
and stuff like that. Try to explicitly specify the desired settings file when starting the server
python manage.py runserver --settings mysettingspackage.mysettingsmodule
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question