Martin Lorenz writes:

 > (venv) mailman@arda:/etc/exim4$ python manage.py hyperkitty_import -l 
 > stammesleit...@list.poc.im 
 > /data/var/lib/mailman/archives/private/stammesleitung.mbox/stammesleitung.mbox
 >  

Executive summary: you have to specify an absolute or relative path
to manage.py.

Here's why.  When invoked as "python manage.py ..." it is treated as
an ordinary file argument (that happens to be a Python script), and is
not searched for on Python's sys.path or on the shell's PATH.

When invoked as "python -m manage ..." it is treated as a module, and
searched for on sys.path.  But don't do this, there are differences
between "python foo.py" and "python -m foo", and manage.py is not
designed to be invoked with "-m".  Also, the same Django installation
may support a variety of applications each of which has its own
manage.py, and there's no reason to suppose the one that's first on
sys.path is the one you want unless you are already cd'ed to
manage.py's directory.  For example, before the creation of Mailman
web, both HyperKitty and Postorius had their own manage.py.  In fact,
in some applications manage.py may not be on sys.path at all (unless
it's in the current working directory).

Steve

------------------------------------------------------
Mailman-Users mailing list -- mailman-users@python.org
To unsubscribe send an email to mailman-users-le...@python.org
https://mail.python.org/mailman3/lists/mailman-users.python.org/
Mailman FAQ: http://wiki.list.org/x/AgA3
Security Policy: http://wiki.list.org/x/QIA9
Searchable Archives: https://www.mail-archive.com/mailman-users@python.org/
    https://mail.python.org/archives/list/mailman-users@python.org/

Reply via email to