1) I get this after issuing print sys.path in python interpreter:
>>> import sys
>>> print sys.path
['', '/usr/local/lib/python2.6/dist-packages/pip-0.8.2-py2.6.egg', '/
root/src/django-caching-app-plugins', '/root/src/django-keyedcache', '/
root/src/django-livesettings', '/root/src/django-signals-ahoy', '/root/
src/satchmo/satchmo/apps', '/usr/local/lib/python2.6/dist-packages/
django_threaded_multihost-1.4_0-py2.6.egg', '/srv/www/duckling.org/
store', '/usr/lib/python2.6', '/usr/lib/python2.6/plat-linux2', '/usr/
lib/python2.6/lib-tk', '/usr/lib/python2.6/lib-old', '/usr/lib/
python2.6/lib-dynload', '/usr/lib/python2.6/dist-packages', '/usr/lib/
python2.6/dist-packages/PIL', '/usr/lib/pymodules/python2.6', '/usr/
local/lib/python2.6/dist-packages']
2) echo $PYTHONPATH gives me this: /srv/www/duckling.org/store
3) Next here are the errors I am getting from my server logs, this
time it seems to be telling me that store.settings isn't loading, but
I could be wrong about that:
mod_wsgi (pid=4053): Exception occurred processing WSGI script '/srv/
www/duckling.org/store/wsgi-scripts/django.wsgi'.
Traceback (most recent call last):
File "/usr/local/lib/python2.6/dist-packages/django/core/handlers/
wsgi.py", line 230, in __call__
self.load_middleware()
File "/usr/local/lib/python2.6/dist-packages/django/core/handlers/
base.py", line 33, in load_middleware
for middleware_path in settings.MIDDLEWARE_CLASSES:
File "/usr/local/lib/python2.6/dist-packages/django/utils/
functional.py", line 276, in __getattr__
self._setup()
File "/usr/local/lib/python2.6/dist-packages/django/conf/__init__.py",
line 40, in _setup
self._wrapped = Settings(settings_module)
File "/usr/local/lib/python2.6/dist-packages/django/conf/__init__.py",
line 75, in __init__
raise ImportError("Could not import settings '%s' (Is it on sys.path?
Does it have syntax errors?): %s" % (self.SETTINGS_MODULE, e))
[ImportError: Could not import settings 'store.settings' (Is it on
sys.path? Does it have syntax errors?): No module named store.settings
4) And here is my recent django.wsgi file:
import os
import sys
sys.path.append('/root/src/satchmo/satchmo/apps')
sys.path.append('/srv/www/gnseagle.org/store')
os.environ['DJANGO_SETTINGS_MODULE'] = 'store.settings'
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
5) And I'm unfamiliar with this way of doing it so not sure what to do
as far as this suggestion:
"If those directories are special directories containing .pth files,
you actually need to use":
import site
site.addsitedir('/root/src/satchmo/satchmo/app')
6) Looks like I'm getting closer to getting this solved (at least I
think). I'm going to read over the wsgi docs again while I wait and
see what you think about the above configurations.
Thanks for your help,
Jim
On Dec 12, 12:39 am, Graham Dumpleton <[email protected]>
wrote:
> Have you by chance set PYTHONPATH environment variable in your user
> environment to include '/root/src/satchmo/satchmo/app'. If you have,
> or if you have other directories listed in PYTHONPATH, then you need
> to replicate them in WSGI script file, adding them to sys.path.
>
> sys.path.append('/root/src/satchmo/satchmo/app')
>
> If those directories are special directories containing .pth files,
> you actually need to use:
>
> import site
> site.addsitedir('/root/src/satchmo/satchmo/app')
>
> instead.
>
> From your command line python see what you get for:
>
> import sys
> print sys.path
>
> and compare that to what sys.path is under mod_wsgi as shown by that
> test script in the wiki document I mentioned.
>
> Also see what you get from shell for:
>
> echo $PYTHONPATH
>
> Graham
>
> Graham
>
> On 12 December 2010 15:34, j <[email protected]> wrote:
>
>
>
>
>
>
>
> > Note taken, I'll stick with one forum from now on. Sorry about
> > that. :/
>
> > The parent directory to satchmo_store is at /apps/satchmo_store/ The
> > entire path is at: /root/src/satchmo/satchmo/apps/satchmo_store/
> > __init__.pyc but not really sure the entire directory path matters.
> > Regardless, thanks for that info, that definitely sounds like where
> > some of my problemsmight be at. I'll look over this in the morning
> > again *and*
> > readhttp://code.google.com/p/modwsgi/wiki/CheckingYourInstallation#Python...
> > as well.
>
> > Thanks again!
> > J.
>
> > On Dec 11, 10:44 pm, Graham Dumpleton <[email protected]>
> > wrote:
> >> BTW, it is annoying when people ask same question in multiple forums.
> >> You are better off sticking to one until they decide you are better
> >> off using a different forum.
>
> >> Graham
>
> >> On 12 December 2010 14:43, Graham Dumpleton <[email protected]>
> >> wrote:
>
> >> > So where is 'satchmo_store' package installed.
>
> >> > Where ever it is, that parent directory isn't in sys.path as searched
> >> > by Python for modules.
>
> >> > This could be because mod_wsgi is using different Python installation
> >> > than you think, you just need to add the required directory to
> >> > sys.path, or you need to fix up permissions on the 'satchmo_store'
> >> > package so user that Apache runs as can access it.
>
> >> > Run 'python' command line and do:
>
> >> > import satchmo_store
> >> > print satchmo_store.__file__
>
> >> > This will tell you where it is installed.
>
> >> > Then use WSGI test script in:
>
> >> > http://code.google.com/p/modwsgi/wiki/CheckingYourInstallation#Python...
>
> >> > to work out what Python mod_wsgi is actually using.
>
> >> > Graham
>
> >> > On 12 December 2010 11:58, j <[email protected]> wrote:
> >> >> Here is some info that might help, then I'll try and explain where
> >> >> some of these files are, it's a very simple set up as I'm very much a
> >> >> beginner at this:
>
> >> >> #################################################
> >> >> # error.log
> >> >> #################################################
> >> >> mod_wsgi (pid=20698): Exception occurred processing WSGI script '/
> >> >> srv/
> >> >> www/duckling.org/store/wsgi-scripts/django.wsgi'.
> >> >> Traceback (most recent call last):
> >> >> File "/usr/local/lib/python2.6/dist-packages/django/core/handlers/
> >> >> wsgi.py", line 230, in __call__
> >> >> self.load_middleware()
> >> >> File "/usr/local/lib/python2.6/dist-packages/django/core/handlers/
> >> >> base.py", line 42, in load_middleware
> >> >> raise exceptions.ImproperlyConfigured('Error importing middleware %s:
> >> >> "%s"' % (mw_module, e))
> >> >> ImproperlyConfigured: Error importing middleware
> >> >> satchmo_store.shop.SSLMiddleware: "No module named
> >> >> satchmo_store.shop.SSLMiddleware
>
> >> >> Here are my config files. I've went though many different versions,
> >> >> this is my latest:
> >> >> ####################################
> >> >> # apache vhost file called duckling.org located in /etc/apache2/sites-
> >> >> available
> >> >> ####################################
> >> >> <VirtualHost 1.2.3.4:80>
> >> >> ServerAdmin [email protected]
> >> >> ServerName duckling.org
> >> >> ServerAliaswww.duckling.org
> >> >> DocumentRoot /srv/www/duckling.org/store/
> >> >> <Directory /srv/www/duckling.org/store/>
> >> >> Order Allow,Deny
> >> >> Allow from all
> >> >> </Directory>
> >> >> Alias /static /srv/www/duckling.org/store/static/
> >> >> <Directory /srv/www/duckling.org/store/static/>
> >> >> AllowOverride None
> >> >> Order deny,allow
> >> >> Allow from all
> >> >> </Directory>
> >> >> WSGIScriptAlias / /srv/www/duckling.org/store/wsgi-scripts/
> >> >> django.wsgi
> >> >> <Directory /srv/www/duckling.org/store/wsgi-scripts/>
> >> >> Order deny,allow
> >> >> Allow from all
> >> >> </Directory>
> >> >> </VirtualHost>
>
> >> >> #########################
> >> >> # django.wsgi file
> >> >> #########################
> >> >> import os
> >> >> import sys
> >> >> sys.path.append('/srv/www/duckling.org/store')
> >> >> os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
> >> >> import django.core.handlers.wsgi
> >> >> application = django.core.handlers.wsgi.WSGIHandler()
>
> >> >> I'm using Linux (Ubuntu 10.04)
> >> >> Apache/2.2.14 (Ubuntu) PHP/5.3.2-1ubuntu4.5 with Suhosin-Patch
> >> >> mod_python/3.3.1 Python/2.6.5 mod_wsgi/2.8
>
> >> >> Thanks for the response back. From what I've gathered I need to open
> >> >> up a "path" from root "/" to my django.wsgi file and to some of my /
> >> >> static files as well. I could be totally wrong about this though. At
> >> >> least I am now getting something from the server logs now. :)
>
> >> >> thanks again,
> >> >> j.
>
> >> >> On Dec 11, 5:24 pm, Graham Dumpleton <[email protected]>
> >> >> wrote:
> >> >>> More than likely if you are adding a new VirtualHost file that you
> >> >>> haven't even linked it into the sites-enabled directory. This presumes
> >> >>> you are or a Linux distribution. That or you have duplicated
> >> >>> VirtualHost for one that exists and the other one is taking
> >> >>> precedence. That or you have set VirtualHost up properly and it is
> >> >>> falling back to default virtual host.
>
> >> >>> Thus, try and work out that your virtual host is set up properly.
>
> >> >>> Next time actually attach your virtual host file, you didn't seem to
> >> >>> last time. Also explain where virtual host file is, what other virtual
> >> >>> host files exist and what they use for ServerName and whether they are
> >> >>> all linked into sites available directory.
>
> >> >>> I am in a hurry so can't say anything more right now.
>
> >> >>> Graham
>
> >> >>> On 12 December 2010 08:41, j <[email protected]> wrote:
>
> >> >>> > Nope, not working after that tutorial either...where do I go now?
>
> >> >>> > On Dec 11, 4:00 pm, j <[email protected]> wrote:
> >> >>> >> Cool, I just
> >> >>> >> foundhttp://code.google.com/p/modwsgi/wiki/IntegrationWithDjango#Integrati...
> >> >>> >> so in the meantime I'm going to start and go through that as the
> >> >>> >> djangoproject site hasn't helped me get this fixed...if you see
> >> >>> >> something I've done that "not right" with my files below feel free
> >> >>> >> to
> >> >>> >> let me know.
>
> >> >>> >> thanks again,
> >> >>> >> j.
>
> >> >>> >> On Dec 11, 3:06 pm, j <[email protected]> wrote:
>
> >> >>> >> > Of course, I might need to give you all more detail instead of
> >> >>> >> > "it's
> >> >>> >> > not working". :D Here is my current django.wsgi file:
>
> >> >>> >> > import os
> >> >>> >> > import sys
>
> >> >>> >> > sys.path.append('/srv/www/duckling.org/store/')
>
> >> >>> >> > os.environ['PYTHON_EGG_CACHE'] =
> >> >>> >> > '/srv/www/duckling.org/store/.python-
> >> >>> >> > egg'
> >> >>> >> > os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
>
> >> >>> >> > import django.core.handlers.wsgi
> >> >>> >> > application = django.core.handlers.wsgi.WSGIHandler()
>
> >> >>> >> > I've tried a few different versions of the django.wsgi file
> >> >>> >> > (including
> >> >>> >> > a version like the one over athttp://www.djangoproject.com/). This
> >> >>> >> > version of my wsgi is from
> >> >>> >> > here:http://library.linode.com/frameworks/django-apache-mod-wsgi/ubuntu-10...
>
> >> >>> >> > Also, here is my vhost apache configuration file. I think these
> >> >>> >> > are
> >> >>> >> > the main files that are suppose to do the job for me. Let me know
> >> >>> >> > if
> >> >>> >> > you see any errors in what I'm doing and what else I might do to
> >> >>> >> > fix
> >> >>> >> > this. The django app runs fine on the django's built-in
> >> >>> >> > development
> >> >>> >> > server so I'm thinking it *might have* something with my paths.
>
> >> >>> >> > No errors in my apache error.log file as well. It's acting as
> >> >>> >> > there's
> >> >>> >> > no problem at all, which is not the case...the project isn't
> >> >>> >> > loading,
> >> >>> >> > like I said just a listing of my files and directories of my
> >> >>> >> > Django
> >> >>> >> > project.
>
> >> >>> >> > Here are versions of the stack that I'm using, I saw over at the
> >> >>> >> > mod_wsgi site that you all would like the versions of what I'm
> >> >>> >> > using
> >> >>> >> > on the server:
> >> >>> >> > Apache/2.2.14 (Ubuntu) PHP/5.3.2-1ubuntu4.5 with Suhosin-Patch
> >> >>> >> > mod_python/3.3.1 Python/2.6.5 mod_wsgi/2.8
>
> >> >>> >> > thanks,
> >> >>> >> > j.
>
> >> >>> >> > On Dec 11, 2:45 pm, j <[email protected]> wrote:
>
> >> >>> >> > > Apache & mod_wsgi are configured correctly (I've created a hello
> >> >>> >> > > world .html apache file and a hello world mod_wsgi application
> >> >>> >> > > with no
> >> >>> >> > > problems). I know need my Django app to recognize my
> >> >>> >> > > django.wsgi file.
> >> >>> >> > > What makes me think that it's not recognizing my wsgi file is
> >> >>> >> > > that I
> >> >>> >> > > went into my django.wsgi file I created and completely deleted
> >> >>> >> > > all of
> >> >>> >> > > the code in the file and restarted Apache and it still gives me
> >> >>> >> > > the
> >> >>> >> > > same page (a listing of the files from Django app, not my actual
> >> >>> >> > > Django application. Configuring Apache and mod_wsgi went really
> >> >>> >> > > well
> >> >>> >> > > but I'm at a loss of how to fix this. Any help would be
> >> >>> >> > > appreciated.
>
> >> >>> >> > > I realize this is probably more of a Django question so I"ll
> >> >>> >> > > ask
> >> >>> >> > > over there as well.
>
> >> >>> >> > > thanks again for the help,
>
> ...
>
> read more »
--
You received this message because you are subscribed to the Google Groups
"modwsgi" 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/modwsgi?hl=en.