On 2 août, 21:43, lmcadory <ljmcad...@gmail.com> wrote:
> I fixed it. I needed to remove --noreload

This doesn't fix anything - try to run it using anything but the test
server and you'll have the same problem (or even worse in a multi-
threading or multi-process environment).

You actually have to  move the first two lines :

  file = 'someFile.txt'
  infile = open(file, 'r')

within your view function.  Else the file is only opened when your
view module is imported, not when the view function is called.

Also, beware that if you don't use an absolute path for the file, it
will be looked for in the "current working directory" whatever it is
at that time (warning: the "current working directory" is NOT your
app's or project directory - it can be absolutely any possible
directory on your filesystem).

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