Running python manage.py command from django with arguments
Question: I have the command :

    
    
    ./manage.py dbbackup --clean --compress
    

provided by the django-dbbackup app which performs a backup of my PostgreSQL
database to Amazon S3. I am trying to run this command inside a django celery
task run daily.

When I run:

> from django.core.management import call_command  
>  call_command('dbbackup --clean --compress', interactive=False)

I am getting an exception because of the clean and compress arguments.

Any ideas on how I can run this command?


Answer: I magically found that running:

    
    
    call_command('dbbackup', clean=True, compress=True, interactive=False)
    

works perfectly.

