Index: django/core/management/commands/runscript.py
===================================================================
--- django/core/management/commands/runscript.py	(revision 0)
+++ django/core/management/commands/runscript.py	(revision 0)
@@ -0,0 +1,90 @@
+from django.core.management.base import BaseCommand
+from django.core.management.color import no_style
+from optparse import make_option
+import sys
+import os
+
+try:
+    set
+except NameError:
+    from sets import Set as set   # Python 2.3 fallback
+
+class Command(BaseCommand):
+    option_list = BaseCommand.option_list + (
+        make_option('--verbosity', action='store', dest='verbosity', default='1',
+            type='choice', choices=['0', '1', '2'],
+            help='Verbosity level; 0=minimal output, 1=normal output, 2=all output'),
+        make_option('--fixtures', action='store_true', dest='infixtures', default=False,
+            help='Only look in app.fixtures subdir'),
+        make_option('--noscripts', action='store_true', dest='noscripts', default=False,
+            help='Look in app.scripts subdir'),
+    )
+    help = 'Runs a script in django context.'
+    args = "script [script ...]"
+
+    def handle(self, *scripts, **options):
+        from django.db.models import get_apps
+
+        subdirs = []
+
+        if not options.get('noscripts'):
+            subdirs.append('scripts')
+        if options.get('infixtures'):
+            subdirs.append('fixtures')
+        verbosity = int(options.get('verbosity', 1))
+        show_traceback = options.get('traceback', False)
+
+        if len(subdirs) < 1:
+            print "No subdirs to run left."
+            return
+
+        if len(scripts) < 1:
+            print "Script name required."
+            return
+
+        def run_script(name):
+            if verbosity > 1:
+                print "check for %s" % name
+            try:
+                t = __import__(name, [], [], [" "])
+
+                if verbosity > 0:
+                    print "Found script %s ..." %name
+                if hasattr(t, "run"):
+                    if verbosity > 1:
+                        print "found run() in %s. executing..." % name
+                    # TODO: add arguments to run
+                    try:
+                        t.run()
+                    except Exception, e:
+                        if verbosity > 0:
+                            print "Exception while running run() in %s" %name
+                        if show_traceback:
+                            raise
+                else:
+                    if verbosity > 1:
+                        print "no run() function found."
+                    
+            except ImportError:
+                pass
+
+
+        for app in get_apps():
+            app_name = app.__name__.split(".")[:-1] # + ['fixtures']
+
+            for subdir in subdirs:
+                for script in scripts:
+                    run_script(".".join(app_name + [subdir, script]))
+
+        # try app.DIR.script import
+        for script in scripts:
+            sa = script.split(".")
+            for subdir in subdirs:
+                nn = ".".join(sa[:-1] + [subdir, sa[-1]])
+                run_script(nn)
+
+            # try direct import
+            if script.find(".") != -1:
+                run_script(script)
+
+
Index: django/core/management/commands/syncdb.py
===================================================================
--- django/core/management/commands/syncdb.py	(revision 6956)
+++ django/core/management/commands/syncdb.py	(working copy)
@@ -136,3 +136,4 @@
         # Install the 'initial_data' fixture, using format discovery
         from django.core.management import call_command
         call_command('loaddata', 'initial_data', verbosity=verbosity)
+	call_command('runscript', 'initial_data', verbosity=verbosity, noscripts=True, fixtures=True)
Index: docs/django-admin.txt
===================================================================
--- docs/django-admin.txt	(revision 6956)
+++ docs/django-admin.txt	(working copy)
@@ -344,6 +344,80 @@
 .. _FastCGI deployment documentation: ../fastcgi/
 .. _flup: http://www.saddi.com/software/flup/
 
+runscript <scriptname scriptname>
+------------------------------------------------
+
+**New in Django development version**
+
+Sometimes its very usefull to have simple scripts in applications which 
+will be called in django's context.
+The runscript command searches for subdirectories named ``scripts`` and 
+``fixtures`` if the --fixtures parameter is given.
+There are two types of simple script types supported:
+
+    * scripts in fixtures. 
+      These scripts are run when runscript
+      ``--fixtures`` option is set. The initial_data.py script is
+      executed after loaddata in syncdb
+    * scripts in scripts.
+      These are the default scripts which will be started with
+      runscript [scriptname]. These can be disabled with ``--noscripts``
+      parameter.
+      A good example is a script called daily_cleanup.py in every application
+      which has to do a daily cleanup.
+
+After import the run() method is executed. You should write::
+
+    def run(*args, **kwargs):
+    	dosomething()
+        ...
+
+<scriptname>
+scriptname can be relative or absolut
+
+	django-admin.py runscript somescript
+
+will walk trough all application scripts subdirectories and
+execute somescript.run()
+
+    django-admin.py runscript myapp.somescript
+
+will execute myapp.scripts.somescript.run()
+
+    django-admin.py runscript --fixtures --noscripts --verbosity=2 initial_data
+
+will call all initial_data scripts in fixtures subdirectories 
+of all applications, printing verbose output what the script does.
+This is is called by syncdb.
+
+**Please remember that directories containing scripts also need a __init__.py**
+
+--fixtures
+~~~~~~~~~~~
+
+Looks in the fixtures subdirectory.
+
+--noscripts
+~~~~~~~~~~~
+
+Don't look in scripts subdirectory for a match.
+
+--verbosity
+~~~~~~~~~~~
+
+Use ``--verbosity`` to specify the amount of notification and debug information
+that ``django-admin.py`` should print to the console.
+
+	* ``0`` means no input.
+	* ``1`` means normal input (default).
+	* ``2`` means verbose input.
+
+Example usage::
+
+    django-admin.py runscript --verbosity=2 initial_data
+
+
+
 runserver [optional port number, or ipaddr:port]
 ------------------------------------------------
 
