#8458: adding own commands to manage.py not working correctly
--------------------------------------+-------------------------------------
Reporter: dafire | Owner: nobody
Status: closed | Milestone: 1.0
Component: django-admin.py | Version: SVN
Resolution: worksforme | Keywords:
Stage: Accepted | Has_patch: 0
Needs_docs: 0 | Needs_tests: 0
Needs_better_patch: 0 |
--------------------------------------+-------------------------------------
Changes (by anonymous):
* status: reopened => closed
* resolution: => worksforme
* component: Uncategorized => django-admin.py
Comment:
Replying to [ticket:8458 dafire]:
> I tried to add my own commands as described in
http://www.djangoproject.com/documentation/django-admin/ but it did not
find my commands.
>
> I did some research and found a problem.
[snipped]
> and call manage.py from the /var/www/proj folder it looks for the
"management" class in /var/www/proj/proj/app/management
Looks like you are misinterpreting the docs. You need to create a folder
called "management" in your app and in it create an empty `__init__.py`
alongwith a sub-folder called "commands". Each command will have a
separate file and will be under the "commands" folder. Also remember to
create another empty `__init__.py` file in the commands folder. Each
command file should contain a class "Command" that should override a
method "handle" that does whatever you want when the command is invoked.
The command tree should look something like this:
{{{
proj/
settings.py
app/
models.py
management/
__init__.py
commands/
__init__.py
mycommand.py
}}}
Please reopen the ticket if I've got something wrong with what you meant
to convey.
--
Ticket URL: <http://code.djangoproject.com/ticket/8458#comment:4>
Django Code <http://code.djangoproject.com/>
The web framework for perfectionists with deadlines
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---