How you call your script in the view? You said that is import as from utils.scriptname import classname but what method do you call in the view.
Remember, all code in script file that are not in a function o class will execute at import time. I guest you have something like def my_view(request): .... classname.mfuction() .... El sábado, 16 de enero de 2016, <raman.bal...@gmail.com> escribió: > Thanks Larry for the reply. Nothing is happening after invoking the script(I think, I am doing something wrong in using the python script in Django views). I have tried running the script separately which is working fine and giving the output. > > On Friday, January 15, 2016 at 8:32:51 PM UTC+5:30, larry....@gmail.com wrote: >> >> On Fri, Jan 15, 2016 at 9:54 AM, <raman....@gmail.com> wrote: >> > Hi, >> > >> > I have a script which is running fine and giving output in the form of list >> > of lists. I want to use that data in my Django view. I am not getting, how >> > to run a script in django view. >> > I created a folder utils inside which, I have put the script. Also, I have >> > created __init__.py in the utils folder. Then, I am importing it in my views >> > as "from utils.scriptname import classname". I'm struggling in that from >> > long and appreciate help. >> >> What happens when you invoke the script? > > -- > 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 https://groups.google.com/group/django-users. > To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/05dceb73-a0c1-4352-8b82-14683d3d0144%40googlegroups.com . > For more options, visit https://groups.google.com/d/optout. > -- "La utopía sirve para caminar" Fernando Birri -- 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 https://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAG%2B5VyOz1EhnF_8b5NxUko6dACvq%2B9hux9JSyM49eLdGqLVyDQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.