Graham, thanks for taking the time to repond. I made the changes in my views
to use only absolute paths, and made the necessary changes to the file
permissions. All seems to work fine now.

On Sun, Aug 9, 2009 at 11:19 PM, Graham Dumpleton <
graham.dumple...@gmail.com> wrote:

>
>
>
> On Aug 9, 4:11 pm, Mac <mmack3...@gmail.com> wrote:
> > Hi,
> >
> > I'm new to Django, and am trying to write a csv file and attach it to
> > an email that is sent upon completion of a sales order. All works fine
> > in the developement server, but when I switch to Apache2 I get an
> > error message that either says' No such file or directory, ../orders1/
> > csv_files/ or Permissions denied etc. All works fine when I use the
> > developement server. Here's my Apache2 sites-available script:
> > <VirtualHost *>
> >         ServerAdmin malc...@sporthill.com
> >         ServerName localhost
> >         ServerAlias localhost/media/
> >         DocumentRoot /home/malcolm/data1/orders1/media
> >         WSGIScriptAlias / /home/malcolm/data1/orders1/apache/django.wsgi
> >         <Directory /home/malcolm/data1/orders1/>
> >         Order allow,deny
> >         Allow from all
> >         </Directory>
> >         <Directory /home/malcolm/data1/orders1/csv_files/>
> >         Order allow,deny
> >         Allow from all
> >         </Directory>
> > </VirtualHost>
> >
> > Apache2 is located in /etc/apache2/
> >
> > My app is in /home/malcolm/data1/orders1/
> >
> > Here's some of the relevant code in my views:
> > for n in new_m:
> >             so_order=n.so_number
> >             so_order=str(so_order)
> >             custo=n.custno/csv_files/"+custo+so_order+".csv", "wb"))
> >
> > Any ideas about what might fix this problem. Any thoughts are
> > appreciated.
>
> Two things.
>
> The first is that you must use absolute path names when referring to
> directories/files as the current working directory of Apache when run
> isn't going to be the same as when you used development server.
>
> Second, the user that Apache runs as will not likely have permissions
> to write to same directories as user you ran development server. You
> need to somehow give Apache permission to write to the directories, or
> use daemon mode of Apache/mod_wsgi and configure the daemon process to
> run as sam user as you used to run development server.
>
> Graham
> >
>

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