Wednesday, July 30, 2014

Re: running script in django database

Agree with Jirka,

I'm just adding the link:
https://docs.djangoproject.com/en/1.6/howto/custom-management-commands/

On 30/07/14 07:53, jirka.vejrazka@gmail.com wrote:
>
> Hi Mohammad,
>
> this can be easily achieved using a custom management command - check the Django documentation.
>
> HTH
>
> Jirka
>
> -----Original Message-----
> From: alghafli <thebsom@gmail.com>
> Sender: django-users@googlegroups.com
> Date: Wed, 30 Jul 2014 07:02:59
> To: <django-users@googlegroups.com>
> Reply-To: django-users@googlegroups.com
> Subject: running script in django database
>
> 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
>
> --
> 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+unsubscribe@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/53D86E73.9060806%40gmail.com.
> For more options, visit https://groups.google.com/d/optout.
>
> --
> 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+unsubscribe@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/417657233-1406705276-cardhu_decombobulator_blackberry.rim.net-1073591500-%40b4.c3.bise7.blackberry.
> For more options, visit https://groups.google.com/d/optout.

--
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+unsubscribe@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/20140730194130.GC2235%40rkade-thinkpad.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment