On Jan 5, 12:55 pm, Graham Dumpleton <[EMAIL PROTECTED]>
wrote:
> On Jan 5, 11:46 am, Ian Bicking <[EMAIL PROTECTED]> wrote:
>
>
>
> > Graham Dumpleton wrote:
> > > On Jan 4, 6:02 pm, "artyom.shalkhakov" <[EMAIL PROTECTED]>
> > > wrote:
> > >> Hello,
>
> > >> I've tried to run Pylons as a WSGI application using apache2.2 and
> > >> mod_wsgi2.0.
> > >> So far simple 'hello world' applications work fine (Pylons through
> > >> paste serve works okay, too).
>
> > >> When I try to run Pylons under mod_wsgi, I get the following error:
>
> > >> [Fri Jan 04 12:36:00 2008] [error] [client 127.0.0.1]
> > >> DistributionNotFound: mysite.com
>
> > >> The app.wsgi looks like this:
>
> > >> from paste.deploy import loadapp
> > >> # yes, everything is under my home directory
> > >> application = loadapp('config:development.ini', relative_to='home/
> > >> artyom/public_html/mysite.com/')
>
> > >> What can be wrong here?
>
> > > Run your application once using 'paster serve' before trying to run it
> > > under mod_wsgi.
>
> > > I haven't looked into what 'paster serve' does yet, but it seems to do
> > > some once off initialisation to set up the site directories properly.
> > > There is possibly some other command which will do the same thing
> > > rather than you actually have to run up the server itself.
>
> > > I was going to investigate and document this, but got side
> > > tracked. :-)
>
> > It doesn't do much.  The logging stuff has some customizations (in
> > paste.script.util.logging_config), but I must admit I don't know quite
> > what they are about; Philip Jenvy did those.
>
> > This sounds like something to do with the actual application loading
> > (any logging stuff isn't being loaded at all).  paster serve really
> > doesn't do much there.  It adds 'config:' to the start of the config
> > file if you don't give it, and can take an explicit app name/section
> > argument (instead of #section) and passes that as the 'name' keyword to
> > loadapp.  But that's it.  It might be hard to see in all the
> > daemonization, reloading, etc stuff in paster serve, but the actual
> > loading and serving of apps is just a very small bit of code.
>
> > Out of curiosity, I grabbed the original version of the command (just
> > the implementation) before it grew so large:
>
> >      def command(self):
> >          app_spec = self.args[0]
> >          app_name = self.options.app_name
> >          if not self._scheme_re.search(app_spec):
> >              app_spec = 'config:' + app_spec
> >          server_name = self.options.server_name
> >          if self.options.server:
> >              server_spec = 'egg:PasteScript'
> >              assert server_name is None
> >              server_name = self.options.server
> >          else:
> >              server_spec = app_spec
> >          base = os.getcwd()
> >          server = loadserver(server_spec, name=server_name,
> >                              relative_to=base)
> >          app = loadapp(app_spec, name=app_name,
> >                        relative_to=base)
> >          server(app)
>
> Hmmm, odd. I tried a fresh new site and didn't have the same problem
> as OP this time, not needing to run paster serve first to make it
> work. The only difference was that this was the second site created
> from the virtualenv setup I was using.
>
> Certainly something odd going on as I know I saw the problem for first
> site created against this virtualenv setup. I'll definitely have to
> dig into it later when I get a chance.

The problem I saw may actually have been something totally different
as I note the OP uses:

  application = loadapp('config:development.ini', relative_to='home/
artyom/public_html/mysite.com/')

whereas I don't use relative_to and instead use just the 'config:'
string with a full path.

What does the relative_to option do?

Maybe the sys.path suggested by someone else was all that was wrong.
Need to know for sure if that was the OPs complete WSGI application
script file. The instructions at:

  http://code.google.com/p/modwsgi/wiki/IntegrationWithPylons

show the need for the sys.path setup, but was that actually done, or
does this relative_to option somehow cause a problem?

Graham


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to pylons-discuss@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to