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)
--
Ian Bicking : [EMAIL PROTECTED] : http://blog.ianbicking.org
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"pylons-discuss" 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/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---