runscript path issue

46 views
Skip to first unread message

Fred Janon

unread,
Jun 7, 2011, 6:03:04 AM6/7/11
to django-e...@googlegroups.com
I can't figure out why my runscript command doesn't work, I can't figure out what path I should put in. Here is the directory structure and the commands with the verbose option, I am trying to get dbmigration to be executed. I created the __init__.py file as indicated in the wiki page. It's empty.

I created the scripts directory and put the __int__.py file in it as well as my dbmigration.py script

ll scripts
total 16
drwxr-xr-x  2 fjanon fjanon 4096 2011-06-07 17:38 ./
drwxr-xr-x 12 fjanon fjanon 4096 2011-06-06 14:52 ../
-rw-r--r--  1 fjanon fjanon  178 2011-06-06 15:04 dbmigration.py
-rw-r--r--  1 fjanon fjanon    0 2011-06-07 17:22 __init__.py
-rw-r--r--  1 fjanon fjanon  127 2011-06-07 17:38 __init__.pyc

fjanon@fred-VirtualBox:~/wardadb$ python manage.py runscript --verbosity 2 scripts migration.py
check for django.contrib.auth.scripts.scripts
check for django.contrib.contenttypes.scripts.scripts
check for django.contrib.sessions.scripts.scripts
check for django.contrib.sites.scripts.scripts
check for django.contrib.admin.scripts.scripts
check for wardadb.warda_original.scripts.scripts
check for wardadb.warda.scripts.scripts
check for scripts.scripts
check for migration.py

fjanon@fred-VirtualBox:~/wardadb$ python manage.py runscript --verbosity 2 /migration.py
check for django.contrib.auth.scripts./migration.py
check for django.contrib.contenttypes.scripts./migration.py
check for django.contrib.sessions.scripts./migration.py
check for django.contrib.sites.scripts./migration.py
check for django.contrib.admin.scripts./migration.py
check for wardadb.warda_original.scripts./migration.py
check for wardadb.warda.scripts./migration.py
check for /migration.py

$ cat scripts/dbmigration.py
assert False

Any ideas?

Thanks

Fred


Fred Janon

unread,
Jun 7, 2011, 10:18:09 PM6/7/11
to django-e...@googlegroups.com
A colleague  helped me on that one, we got the runscript to work with that command:

python manage.py runscript --verbosity 2  dbmigration

Note that there is no .py extension in the command.

The dbmigration.py file has a "def run()" function that gets called by runscript and is in the scripts folder.
I tried dbmigration without a def run() function and dbmigration still gets executed.
The scripts folder has a __init__.py file.
The command is executed from the directory containing the scripts directory that contains itself the __init__.py and dbmigration.py files.

I am stil no sure of what the --noscripts option does.

Maybe it would be nice to add that to the runscript doc?

Fred
Reply all
Reply to author
Forward
0 new messages