running script in django database

36 views
Skip to first unread message

alghafli

unread,
Jul 30, 2014, 12:06:35 AM7/30/14
to django...@googlegroups.com
Hello,
I made a library application using django 1.6. currently I only need to
populate the database. at the beginning, it is easier to write the
information in a csv file and import it using a script.

the script is running fine if I use manage.py shell and import the
necessary file and call the necessary function. however, I want to make
the script run from the system commandline rather than from the python
interpreter since it is easier to pass arguments to it. I could not find
a way in the manage.py documentation page.

Is it possible?

thank you,
Mohammad

jirka.v...@gmail.com

unread,
Jul 30, 2014, 3:28:50 AM7/30/14
to django...@googlegroups.com
Hi Mohammad,

this can be easily achieved using a custom management command - check the Django documentation.

HTH

Jirka
--
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...@googlegroups.com.
To post to this group, send email to django...@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/53D86E73.9060806%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

aRkadeFR

unread,
Jul 30, 2014, 3:40:34 PM7/30/14
to django...@googlegroups.com

alghafli

unread,
Jul 30, 2014, 7:56:23 PM7/30/14
to django...@googlegroups.com
Jirka, aRkadeFR,
Thank you very much. I was able to create the command successfully.

Regards,
Mohammad
Reply all
Reply to author
Forward
0 new messages