Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Let's take a look at <a href="https://github.com/django/django/blob/ffcf24c9ce781a7c194ed8722b850e7873922f6b/django/core/management/__init__.py#L20" rel="nofollow">the part of the source that loads management commands</a>:</p> <pre><code>def find_commands(management_dir): """ Given a path to a management directory, returns a list of all the command names that are available. Returns an empty list if no commands are defined. """ command_dir = os.path.join(management_dir, 'commands') try: return [f[:-3] for f in os.listdir(command_dir) if not f.startswith('_') and f.endswith('.py')] except OSError: return [] </code></pre> <p>which <a href="https://github.com/django/django/blob/ffcf24c9ce781a7c194ed8722b850e7873922f6b/django/core/management/__init__.py#L113" rel="nofollow">is called by</a>:</p> <pre><code># Find and load the management module for each installed app. for app_name in apps: try: path = find_management_module(app_name) _commands.update(dict([(name, app_name) for name in find_commands(path)])) except ImportError: pass # No management module - ignore this app </code></pre> <p>So, yeah, Django doesn't support apps installed in a zipped file, at least here; it wants an explicit <code>commands</code> directory inside <code>management_dir</code>.</p> <hr /> <p>As @tghw notes, installing via <code>pip</code> will keep the package in a directory instead of zipping it. You can also (and probably <em>should</em> also) set <code>zip_safe=False</code> in your <code>setup()</code> command; this will stop setuptools/distribute/etc from trying to zip up your package no matter how you install it.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload