Are you closing the file after you write to it and before you try to send it? Why do you have to write it to a file to deliver it as a static file, why not just render it to a response directly?
On Jan 5, 4:13 am, Alan <alanwil...@gmail.com> wrote: > Hi List, > Because I couldn't find any idea better I am using "MEDIA_URL = '/static/'" > as a repository for the output of my application so I can see the results in > the web interface and download them. > > However, I noticed for a particular case where I open and read a file > content to be viewed in a web page that I get this error: > > ------------------------- > IOError at /ccpngrid/call_status_func > > [Errno 2] No such file or directory: > '/Users/alan/workspace/webapps/static/grid/alan_20090105T094321/static/grid/alan_20090105T093444/Results_1brv_ccpngrid/DOCS/last_it/report' > > Request Method: POST > Request URL:http://localhost:8000/ccpngrid/call_status_func > Exception Type: IOError > Exception Value: > > [Errno 2] No such file or directory: > '/Users/alan/workspace/webapps/static/grid/alan_20090105T094321/static/grid/alan_20090105T093444/Results_1brv_ccpngrid/DOCS/last_it/report' > > Exception Location: /Users/alan/workspace/webapps/src/webAppsRoutines.py in > callStatusFunc, line 518 > ------------------------- > > If I stop and restart the sever (manager.py runserver) it seems that my > static folder gets refreshed and then the server is now aware of this > 'report' file and then I can see it. If during this runserver session, I > submit another job, the new report will failed as show above. > > So, is it possible to "refresh" my "MEDIA_URL = '/static/'" in runserver > session without needing to restart it, or better rethink all the way I did > for presenting results (not using "MEDIA_URL = '/static/'" basically)? > Suggestions are welcome. > > Many thanks in advance. > > Alan > > -- > Alan Wilter S. da Silva, D.Sc. - CCPN Research Associate > Department of Biochemistry, University of Cambridge. > 80 Tennis Court Road, Cambridge CB2 1GA, UK. > > >>http://www.bio.cam.ac.uk/~awd28<< --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---