Thanks Mark for your reply.

On Mon, Jan 5, 2009 at 14:25, Mark Jones <mark0...@gmail.com> wrote:

>
> Are you closing the file after you write to it and before you try to
> send it?


Pretty sure about it. In fact, after try and error I found out that
restarting the server and my static folder gets refreshed and aware of this
particular file and code works.


> 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?


But it was like that, however, the file content I want to show is 'report',
without extension, so mimetype is unknown for most browsers, so instead of
showing the content, it prompted for download (which I don't want). If I
could only set the mimetype to 'text/html', but then I couldn't find a way
then reading the content and rendering with <pre><code> using a view and
template.


> 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<<
> >
>


-- 
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to