Each django-admin.py ( manage.py ) command, as shown in the documentation , you can call from your code with:
from django.core.management import call_command call_command('loaddata', 'myapp')
If the first parameter is the command name, all other position parameters are the same as the command line parameters, and all keyword parameters are parameters.
Alex Koshelev May 20 '09 at 1:24 pm 2009-05-20 13:24
source share