I used this method and got my script working OK. On Wednesday, 13 August 2014 15:37:30 UTC+1, Andrew Farrell wrote: > > Note: this is much better documented at > https://docs.djangoproject.com/en/dev/howto/custom-management-commands/ > > You want to move this file to the management.commands module. I don't know > what the equivalent commands are on windows, but on linux this would be. > 1) `cd myapp; mkdir management`: Within you app, in the same directory as > views.py create a directory called 'management' > 2) `cd management`: Go into that directory > 3) `touch__init__.py`: create an empty file named __init__.py > 4) `mkdir commands`: create a directory named "commands" > 5) `cd commands`: go into that directory > 6) `touch __init__.py`: create another empty file named__init.py > 7) `echo 'from django.conf import settings' > mycommandname.py`: create a > file named with the command you want within that directory. > 8) You need to have something in that file that looks like: > > from django.core.management.base import BaseCommand > class Command(BaseCommand): > args = 'spam eggs' > help = 'makes an omelette to throw at a silly English knigget' > def handle(self, *args, **swargs): > print settings.STATIC_ROOT > >
-- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/77fa1182-7ee1-48ef-bbe3-7b7235087307%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.