Opened 10 years ago

Closed 10 years ago

#2868 closed enhancement (wontfix)

[patch] Allow use of manage.py to run maintenance scripts

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

Description

The attached patch adds a 'runscript' action to management.py that takes a script path as its sole argument.

This is intended to make running maintenance scripts more convenient, and require less repetition (as DJANGO_SETTINGS_MODULE need not be set if used from manage.py)

Attachments (1)

runscript.diff (1.5 KB) - added by adurdin@… 10 years ago.

Download all attachments as: .zip

Change History (5)

Changed 10 years ago by adurdin@…

Attachment: runscript.diff added

comment:1 Changed 10 years ago by James Bennett

Resolution: duplicate
Status: newclosed

Duplicate of #2406.

comment:2 Changed 10 years ago by adurdin@…

Resolution: duplicate
Status: closedreopened

Although this patch has the same motivation, I don't think it's a duplicate of #2406, as the implementations are very different. This one is just a convenience for running a python script within a Django project in the same way that 'manage.py shell' is a convenience for starting an interactive shell in a Django project.

comment:3 Changed 10 years ago by Simon G. <dev@…>

Needs documentation: set
Triage Stage: UnreviewedDesign decision needed
Version: SVN

comment:4 Changed 10 years ago by Russell Keith-Magee

Resolution: wontfix
Status: reopenedclosed

manage.py isn't magic - it does an import settings, then calls the management module (open up manage.py if you want proof). Do the same on your script, and it will behave the same as manage.py.

Note: See TracTickets for help on using tickets.
Back to Top