librelist archives

« back to archive

strange root_path on production with mod_wsgi

strange root_path on production with mod_wsgi

From:
paalzza
Date:
2013-04-21 @ 22:39
Hello friends!

I experience strange root_path in apache2/mod_wsgi with the following 
(standard, i believe) config

         DocumentRoot /home/pony/htdocs/may/www
         <Directory /home/pony/htdocs/may/www>
                 Options FollowSymLinks
                 AllowOverride None
         </Directory>

         <IfModule mod_wsgi.c>
                 WSGIDaemonProcess may 
python-path=/home/pony/htdocs/may/flask2
                 WSGIScriptAlias / /home/pony/htdocs/may/flask2/wsgi.py

                 <Directory /home/pony/htdocs/may/flask2>
                         WSGIProcessGroup may
                         WSGIApplicationGroup %{GLOBAL}
                         Order deny,allow
                         Allow from all
                 </Directory>
         </IfModule>

The error i get is "TemplateNotFound" (while it is there). While 
debugging i found out that "app.root_path" is not 
"/home/pony/htdocs/may/flask2", as it should be, but "/home/pony" instead.
For now i have dirty-hacked it to 
app.root_path='/home/pony/htdocs/may/flask2' in wsgi.py, but i'd rather 
prefer having it working normally.