No custom management commands for django-admin.py?

4 views
Skip to first unread message

Joseph Kocherhans

unread,
Oct 25, 2007, 1:03:52 PM10/25/07
to django-d...@googlegroups.com
I looked around in the various tickets and threads for the reasoning
behind this, and wasn't able to find anything. Is there a particular
reason django-admin.py doesn't load custom commands? Changing this
line [1] makes everything work fine in my tests.

Is it just that it would require you to specify settings? (via
--settings or $DJANGO_SETTINGS_MODULE) Seems like catching the
ImportError and issuing a friendly warning "Custom commands will not
be loaded because settings were not specified", or maybe even failing
silently would work fine.

Joseph

[1] http://code.djangoproject.com/browser/django/trunk/django/core/management/__init__.py#L150

Russell Keith-Magee

unread,
Oct 26, 2007, 2:22:40 AM10/26/07
to django-d...@googlegroups.com
On 10/26/07, Joseph Kocherhans <jkoch...@gmail.com> wrote:
>
> I looked around in the various tickets and threads for the reasoning
> behind this, and wasn't able to find anything. Is there a particular
> reason django-admin.py doesn't load custom commands? Changing this
> line [1] makes everything work fine in my tests.
>
> Is it just that it would require you to specify settings? (via
> --settings or $DJANGO_SETTINGS_MODULE)

There are two minor differences between django-admin and manage.py:
manage.py disables the startproject command, and adds the startapp
command.

At present, the decision as to whether to remove startproject and add
startapp is based entirely on which script was invoked (django-admin
or manage). However, it would make good sense for this distinction to
be made based on whether a settings file was available. I can't think
of any reason that 'django-admin.py --settings=foo.settings' should be
any different to running 'manage.py' in the foo project.

Russ %-)

Reply all
Reply to author
Forward
0 new messages