0

I have to create a django command which needs to call another django command, so I had to use call_command which seems to be cool and simple:

call_command('command_to_call', new_text='arghslkjt')

The command command_to_call is supposed to store new_text content into the database. However, it returns

.......
call_command('command_to_call', new_text='arghslkjt')
                                       ^
SyntaxError: invalid syntax

make_option('-n','--new_text',
   type='string',
   dest='new_text',
   help='specify the new text title'),

Any ideas?

Thanks in advance

smarber
  • 4,829
  • 7
  • 37
  • 78
  • is it the actual code which is throwing syntax error? I don't see any syntax error here `call_command('command_to_call', new_text='arghslkjt')` – Aamir Rind Mar 28 '13 at 16:31
  • Fixed now, no actually it's not the actual code, I was using import in place of new_text, and because import is a keyword, it didn't work. Sorry for the "typo" and thanks anyway :) – smarber Mar 28 '13 at 17:09

0 Answers0