I have the following django management command:
fabrictest.py
from django.core.management.base import NoArgsCommand
import locale
class Command(NoArgsCommand):
def handle_noargs(self, **options):
print locale.getdefaultlocale()
Which I can run locally:
$ /home/user/env/bin/python manage.py fabrictest
('en_US', 'UTF-8')
However, when I run the command remotely using the following fabric task
@task
def test():
# run manage.py using the python bin from the virtualenv
with cd(env.project_root):
run("/home/user/env/bin/python manage.py fabrictest")
I get the following output
[server] Executing task 'test'
[server] run: /home/user/env/bin/python manage.py fabrictest
[server] out: (None, None)
Why do I get (None, None)
instead of ('en_US', 'UTF-8')
?. This generates errors for some other management scritps (namely, syncdb
when creating the superuser).