Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#3528 closed (wontfix)

simple cli extensions for and

Reported by: Ronny Pfannschmidt Owned by: Adrian Holovaty
Component: Core (Management commands) Version: master
Severity: Keywords:
Cc: Triage Stage: Design decision needed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


just ran across the point where its nice to have custom commands for the cli

it would simplify setting up daily actions and other tasks wich arent well-suited for the web interface

it would be nice to have something like

./ run $myapp $mycommand $myargs

## examples
./ run sessions clean
./ run notifications daily
./ run forum update post_cache

Attachments (1) (1.6 KB) - added by phil.h.smith@… 10 years ago.
pseudo code for overriding execute_manager to add custom ./ actions

Download all attachments as: .zip

Change History (8)

comment:1 Changed 10 years ago by phil.h.smith@…

We worked out a sketch of how to try this in the irc (see attachment.) We found we had to duplicate so we could customize action_mapping before passing to execute_from_command_line.

There seem to be some ways to make this happier and drier. The one that seems cleanest to me is to give execute_manager a default-able action_mapping parameter that would augment and/or replace the default one. Another is to remove the startapp/startproject magic from it (leaving it basically empty) so we don't feel bad duplicating 'n overriding.

Changed 10 years ago by phil.h.smith@…

Attachment: added

pseudo code for overriding execute_manager to add custom ./ actions

comment:2 Changed 10 years ago by Ronny Pfannschmidt <ronny.pfannschmidt@…>

nice method, but it's on project basis

usually applications need the custom commands, not projects (wich are just combinations of applications)

comment:3 Changed 10 years ago by ramiro <rm0 _at_>

See #2868

comment:4 in reply to:  3 Changed 10 years ago by anonymous

Triage Stage: UnreviewedDesign decision needed

#2868 is about project level scripts, this ticket about application level scripts, so it's not a duplicate.

comment:5 Changed 10 years ago by mir@…

Last comment was from me, sorry.

comment:6 Changed 10 years ago by Malcolm Tredinnick

Resolution: wontfix
Status: newclosed

All does is set DJANGO_SETTINGS_MODULE in the environment and puts the current project is on the path. So it's trivial to replicate that for scripts you want to run -- like literally one line.

It doesn't make sense to think of on a per-app level, outside of projects, because settings files are on a project level. If your apps aren't all under one project, you need to set the Python paths manually yourself anyway so that they are accessible (if not on default paths), so doesn't help you there.

This isn't worth implementing because it doesn't really make anything easier than it already is.

comment:7 Changed 10 years ago by Jacob

Reporter: changed from Ronny Pfannschmidt <ronny.pfannschmidt@…> to Ronny Pfannschmidt
Note: See TracTickets for help on using tickets.
Back to Top