[Answer]-Running fabfile task from django

1👍

Here’s the section on how to use fabric as a python module/library without using the fab command to run tasks.

Short example:

from fabric.api import execute
#import your task if it is not in the same module, i.e.:
from mytasks import run_task

execute(run_task, hosts='hostname')
👤Morgan

0👍

I think you should place this logic somewhere in your Django app. And let run_task be just a wrapper around this logic.

It is fabfile that’s based on the app, not vise versa.

Leave a comment