On 18 July 2011 15:41, Shawn Milochik <sh...@milochik.com> wrote: > On Mon, Jul 18, 2011 at 10:33 AM, bruno desthuilliers > <bruno.desthuilli...@gmail.com> wrote: > > On Jul 18, 3:33 pm, Alexander Crössmann > > <alexander.croessm...@gmail.com> wrote: > >> Hi Malcom, > >> > >> I am not sure the management commands are what I want > > > > Strange enough, it seems that everyone starts by saying this and ends > > up writing custom management commands ;) > > > > > Getting the DJANGO_SETTINGS_MODULE correct is all that's needed. I've > never created a management command, nor needed to. >
While it's true you don't *need* to, my experience is it's better to. Every time I've created a separate script to interact with a Django app, it has subsequently been broken when I've changed something in the app. Usually this has gone unnoticed until some inconvenient time. If you make the script a management command, you have an easy way to build tests for it right into your app, so that it's impossible (ok, hard) for changes to break the script without you noticing. So my advice: if you're actively developing your app, then make any scripts that need to furtle about with the models management commands. Malcolm -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.