Hi Dominique,
I'm going to start by pointing you to the Fabric documentation here:
http://docs.fabfile.org/en/1.4.3/. There is nothing magical about how
Mezzanine uses Fabric.
The `python` function can be found here:
https://github.com/stephenmcd/mezzanine/blob/master/mezzanine/project_template/fabfile.py#L291-302
Line 294 contains the docstring for the `python` function - Runs
Python code in the project's virtual environment, with Django loaded.
So your "unimpressive" example is exactly how it works. More elaborate
examples, including running blocks of code, can be seen in the source,
e.g.
https://github.com/stephenmcd/mezzanine/blob/master/mezzanine/project_template/fabfile.py#L291-302.
Hope that helps.
best,
ken
On Thu, Sep 27, 2012 at 10:36 AM, Dominique <
dbis...@gmail.com> wrote:
> Hello,
>
> Can anyone provide some tips on effective ways to use the fab python
> command?
>
> I can do the following, but it's not impressive:
>
> fab python:"print 'hello world'"
>
>
> For instance, how would one run a block of code?