I'm trying to use Werkzeug in my Django project, which essentially is a web-page Python shell interface. I want to run commands such as python manage.py syncdb
and python manage.py migrate
but in the Python shell it isn't very straightforward.
I tried import manage
and attempting commands from there, but from the looks of the source of manage.py, there's nothing to call, as it passes arguments to django.core.management.execute_from_command_line()
.
I also tried defining a function as shown "Running shell command from Python and capturing the output", but calling it using
runProcess('Python manage.py syncdb')
returns only:
<generator object runProcess at 0x000000000520D4C8>