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