On Jun 22, 12:03 am, watad <awa...@gmail.com> wrote: > hi all, > > im using djapian for my search , it seems to work fine when i run it > in django development server > but when i configure my sites to use apach2 im always getting this > error when i try to search : > > "Caught OSError while rendering: [Errno 13] Permission denied: '/ > index'" > i am sure it is not a folder permission issue because when i run my > sites using ./manage.py runserver i get the results of my search. > > im using mod_wsgi > > my locasites.conf : > > # ------------------------------------------- > > <VirtualHost myip:80> > ServerName mysite.name > ServerAlias mysitealias > > WSGIScriptAlias / "/path/to/my/apache/file.wsgi" > <Directory "/path/to/my/apache"> > Allow from all > </Directory> > > Alias /site_media/ "/path/to/mysite/media/" > <Directory "/path/to/mysite/media/"> > Order allow,deny > Options Indexes FollowSymLinks > Allow from all > IndexOptions FancyIndexing > </Directory> > > Alias /media/ "/usr/local/lib/python2.6/dist-packages/django/ > contrib/admin/media/" > <Directory "/usr/local/lib/python2.6/dist-packages/django/contrib/ > admin/media/"> > Order allow,deny > Options Indexes FollowSymLinks > Allow from all > IndexOptions FancyIndexing > </Directory> > > </VirtualHost> > > this is repeated for all the sites. > > can anyone help with issue
Don't use relative path names in your code, you must use absolute path names. As the current working directory under Apache is usually '/', relative path names will resolve relative to that and not your site directory as with runserver. Thus, if you have simple 'index' in your code as relative path name, that will resolve to '/index' and because Apache user cannot write to '/' directory you will get an OSError like you are seeing. 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-us...@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.