Thank you for your help, that sorted that issue! On Nov 22, 5:18 pm, Tom Evans <tevans...@googlemail.com> wrote: > On Tue, Nov 22, 2011 at 10:35 AM, marjenni > > > > > > > > > > <mark.jennings.em...@gmail.com> wrote: > > Hi all, > > I have been writing a django app, and testing locally using > > runserver. > > > Now I am in the process of moving this app to an online server, but am > > having some problems. > > > On initialisation the app initialises itself with a .csv file I have > > created, but with the online version I keep getting: > > > IOError at / > > > [Errno 13] Permission denied: '/cache/parks_extended_info.csv' > > > I have been playing with file permissions and owners, but just can't > > get it to work. > > > This is my first django app, so the solution is probably simple! > > > thanks > > > Mark > > So, the error is pretty clear - you are trying to open > '/cache/parks_extended_info.csv', and that fails with permission > denied (errno 13). It's not clear what mode you are opening it with - > for reading or for writing? > > Some wild speculation - are you really intending to open > '/cache/parks_extended_info.csv' or should that path be prepended with > your project path? > > When you run it in development, your working directory is probably > '/path/to/project', and so when you open > 'cache/parks_extended_info.csv', it correctly opens > '/path/to/project/cache/parks_extended_info.csv'. > > When you run it in production, working directory is probably '/', so > when you open 'cache/parks_extended_info.csv', it tries to open > '/cache/parks_extended_info.csv', which probably doesn't exist. > > On the other hand, if you are really trying to open > '/cache/parks_extended_info.csv', then you just need to make sure that > you have appropriate read permissions on the file, and execute > permissions on any intermediary directories, for the user that your > code is running as. If you run these commands, it should be clear why > you are denied: > > ls -ld /cache > ls -l /cache/parks_extended_info.csv > > If you intend to write to the file - or open the file in write or > append mode - you must also have write permission to the directory, > and to the file if it already exists. > > Cheers > > Tom
-- 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.