I'm trying to configure apache2 + virtualenv + django + wsgi + fls
I already have the virtualenv with python 2.6 and django 1.1.4
working.
note01:/var/log/apache2# source /home/mariano/Python/virtualenvs/lfs/
bin/activate
(lfs)note01:/var/log/apache2# python
Python 2.6.6 (r266:84292, Apr 20 2011, 11:58:30)
[GCC 4.5.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import django
>>> django.VERSION
(1, 1, 4, 'final', 0)
>>>
path to virtualenv = /home/mariano/Python/virtualenvs/lfs/
path to the fls site = /home/mariano/Python/WEBS/podio_shop/
path to django 1.3 site = /home/mariano/Python/WEBS/mysite/
when i run the server thouth the virtualenv with python manage.py
runserver it load ok the fls shop at localhost:8000
but when I configure apache2 it doen't.
the site of django 1.3 it works ok, without virtualenv.
the files:
------------->httpd.conf
WSGIScriptAlias /mysite /home/mariano/Python/WEBS/mysite/apache/
django.wsgi
WSGIScriptAlias /podio_shop /home/mariano/Python/WEBS/podio_shop/
apache/django.wsgi
------------->virtual host
<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot /var/www/
<Directory /home/mariano/Python/WEBS/mysite/apache/>
Order allow,deny
allow from all
</Directory>
<Directory /home/mariano/Python/WEBS/podio_shop/apache/>
Order allow,deny
allow from all
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
# Possible values include: debug, info, notice, warn, error,
crit,
# alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>
</VirtualHost>
------------->/home/mariano/Python/WEBS/mysite/apache/django.wsgi
import os
import sys
path = '/home/mariano/Python/WEBS'
if path not in sys.path:
sys.path.append(path)
os.environ['DJANGO_SETTINGS_MODULE'] = 'mysite.settings'
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
------------->/home/mariano/Python/WEBS/mysite/apache/django.wsgi
import os
import sys
sys.stdout = sys.stderr
import site
site.addsitedir('/home/mariano/Python/virtualenvs/lfs/lib/python2.6/
site-packages')
path = '/home/mariano/Python/WEBS'
path2 = '/home/mariano/Python/WEBS/podio_shop'
if path not in sys.path:
sys.path.append(path)
sys.path.append(path2)
os.environ['PYTHON_EGG_CACHE'] = '/home/mariano/Python/WEBS/podio_shop/
apache/egg-cache'
os.environ['DJANGO_SETTINGS_MODULE'] = 'podio_shop.settings'
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
The error:
AttributeError at /
'AdminSite' object has no attribute 'root'
Request Method: GET
Request URL: http://localhost/
Django Version: 1.3
Exception Type: AttributeError
Exception Value:
'AdminSite' object has no attribute 'root'
Exception Location: /home/mariano/Python/WEBS/podio_shop/urls.py in
<module>, line 22
It says django version 1.3 so I think the problem is in the wsgi file
of /home/mariano/Python/WEBS/podio_shop/apache/django.wsgi
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en.