Closed bijenkins closed 9 years ago
I researched on the internet this issue further, and see that it only occurs when trying to actually add variable data for the template. So I tried ever order imaginable, and a direct copy and paste of your examples has not worked for me. Please take a look when available.
send_db_mail({'snmp_location':'This is a test'}, slug='welcome', recipient='test@mysite.com', use_celery=False) Traceback (most recent call last): File "
", line 1, in TypeError: send_db_mail() got multiple values for keyword argument 'slug' send_db_mail (slug='welcome', {'snmp_location':'This is a test'}, recipient='test@mysite.com', use_celery=False)
File "", line 1 SyntaxError: non-keyword arg after keyword arg send_db_mail (slug='welcome', {'snmp_location':'This is a test'}, recipient='test@mysite.com')
File "", line 1 SyntaxError: non-keyword arg after keyword arg send_db_mail (slug='welcome', recipient='test@mysite.com', {'snmp_location':'This is a test'}) File "
", line 1 SyntaxError: non-keyword arg after keyword arg send_db_mail (slug='welcome', recipient='test@mysite.com', {'snmp_location':'This is a test'}, use_celery=False) File "
", line 1 SyntaxError: non-keyword arg after keyword arg
slug='welcome' , recipient='test@mysite.com' - because this is a not named arguments. Look to my examples on README. On basic example which you are using, I showed all possible keywords, slug and recipient can not be used as keyword.
def send_db_mail(slug, recipient, *args, **kwargs):
...
This happens no matter which way, I try to add *args to be pulled into the template context. I tryed data={"test":"This is a test"} with the same result.
Line 11: ... # All args params will be accessible on template context ... { < *** ... 'username': request.user.username,
Python 2.7.9 Django 1.7.4