Hello all,
I can't seem to resolve the error in my Apache error_log saying "Import
Error: No module named site." It is in my virtual environment's library top
level directory, so I'm not sure what setting is incorrect. I've tried many
attempts to get this going, but nothing from the guides seems to be working.
I've included the wsgi and apache config file.
Thanks!
apache-wsgi.conf
#WSGIPythonHome /foodir/data/www/newrb/venv
#WSGIPythonPath /foodir/data/www/rbdev/conf
<VirtualHost *:443>
ServerName rbdev
DocumentRoot "/foodir/data/www/rbdev/htdocs"
SSLEngine on
SSLCertificateFile /foodir/etc/ssl/rbdev.crt
SSLCertificateKeyFile /foodir/etc/ssl/rbdev.key
SetEnv HTTPS on
# Error handlers
ErrorDocument 500 /errordocs/500.html
ErrorLog logs/rbdev.ssl_error_log
TransferLog logs/rbdev.ssl_access_log
LogLevel warn
WSGIDaemonProcess reviewboard python-home=/foodir/data/www/newrb/venv
python-path=/foodir/data/www/newrb/venv/lib/python2.7/site-packages:/foodir/data/www/rbdev/conf
#python-home=/foodir/data/www/newrb/venv python-path=/foodir/data/www/newrb
processes=1 threads=8
WSGIProcessGroup reviewboard
WSGIApplicationGroup %{GLOBAL}
WSGIPassAuthorization On
WSGIScriptAlias "/" "/foodir/data/www/rbdev/htdocs/reviewboard.py"
process-group=reviewboard
<Directory "/foodir/data/www/rbdev/htdocs">
AllowOverride All
Options -Indexes +FollowSymLinks
Require all granted
</Directory>
# Prevent the server from processing or allowing the rendering of
# certain file types.
<Location "/media/uploaded">
SetHandler None
Options None
AddType text/plain .html .htm .shtml .php .php3 .php4 .php5 .phps .asp
AddType text/plain .pl .py .fcgi .cgi .phtml .phtm .pht .jsp .sh .rb
<IfModule mod_php5.c>
php_flag engine off
</IfModule>
# Force all uploaded media files to download.
<IfModule mod_headers.c>
Header set Content-Disposition "attachment"
</IfModule>
</Location>
# Alias static media requests to filesystem
Alias /media "/foodir/data/www/rbdev/htdocs/media"
Alias /static "/foodir/data/www/rbdev/htdocs/static"
Alias /errordocs "/foodir/data/www/rbdev/htdocs/errordocs"
Alias /favicon.ico
"/foodir/data/www/rbdev/htdocs/static/rb/images/favicon.png"
</VirtualHost>
reviewboard.wsgi
python_home = '/foodir/data/www/newrb/venv'
activate_this = python_home + '/bin/activate_this.py'
execfile(activate_this, dict(__file__=activate_this))
import os
import sys
#sys.stderr.write('Before appends\n')
#sys.stderr.write('\n'.join(sys.path))
#sys.stderr.write('\n############################\n')
# Add site-packages of virtual env to use
#site.addsitedir('/foodir/data/www/newrb/lib/python2.7/site-packages')
#sys.path.insert(0,'/foodir/data/www/newrb/venv/lib/python2.7/site-packages')
# Add app's directory to pythonpath
#sys.path.append('/foodir/data/www/rbdev')
#sys.path.append('/foodir/data/www/rbdev/htdocs')
#sys.path.append('/foodir/data/www/rbdev/conf')
#sys.stderr.write('\n'.join(sys.path))
import __main__
__main__.__requires__ = ['ReviewBoard']
import pkg_resources
os.environ['DJANGO_SETTINGS_MODULE'] = "reviewboard.settings"
os.environ['PYTHON_EGG_CACHE'] = "/foodir/data/www/rbdev/tmp/egg_cache"
os.environ['HOME'] = "/foodir/data/www/rbdev/data"
# Pythonpath is NULL before this.
os.environ['PYTHONPATH'] =
'/foodir/data/www/rbdev/conf:/foodir/data/www/newrb/venv/lib/python2.7/site-packages'
+ os.environ.get('PYTHONPATH', '')
#sys.path = ['/foodir/data/www/rbdev/conf'] + sys.path
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
--
Supercharge your Review Board with Power Pack:
https://www.reviewboard.org/powerpack/
Want us to host Review Board for you? Check out RBCommons:
https://rbcommons.com/
Happy user? Let us know! https://www.reviewboard.org/users/
---
You received this message because you are subscribed to the Google Groups
"Review Board Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.