On Aug 29, 10:17 pm, Chris McDonough <[email protected]> wrote:
> On Mon, 2011-08-29 at 14:01 -0700, Ben Sizer wrote:
> > I have found what is probably the cause of the problem though - it's
> > not executing myapp/_init__.py at all, so my view code is never being
> > run. The top of development.ini says this, which looks right:
>
> >     [app:myapp]
> >     use = egg:myapp
>
> > So what could be going wrong? Is paster picking up a phantom install
> > from somewhere else?
>
> Maybe.  Hard to know really.  If you do:
>
> $ $yourvirtualenv/bin/python
>
> >>> import myapp
> >>> myapp.__file__
>
> Is the path to myapp what you expect it to be?

Hah, that was it. No, it wasn't what I expected. I had expected this:

    /home/kylotan/webapps/testproj/myapp/python2.7/myapp/__init__.pyc

But it was actually:

    /home/kylotan/webapps/testproj/lib/python2.7/myapp/__init__.pyc

It looks like the install process has installed the project as a
package in the lib directory which takes precedence over the app
itself in the main directory.

I have no idea whose fault that is, because Python packaging is still
entirely opaque to me after a decade of use, but perhaps it's
something Webfaction do wrong when they run the quickstart? (I expect
there's something else wrong in that they don't require that you
activate the virtualenv before running the app, but it doesn't seem to
make any difference to me either way.)


>  If not, run
> "$yourvirtualenv/bin/python setup.py develop" again and see if that
> fixes it.

Yep, that seems to switch the order around so that it picks up my
files first. Thanks!

--
Ben Sizer

-- 
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.

Reply via email to