Hi Lucas,

On Sep 23, 8:29 pm, Lukasz Szybalski <[email protected]> wrote:
> On Wed, Sep 23, 2009 at 2:08 PM, davidjagoe <[email protected]> wrote:
>
> > I have just used modwsgideploy to generate sample apache
> > configuration. The sample apache config suggests that its a bad idea
> > to install my TG2 application into site-packages:
>
> > Could anyone tell me why that is a bad idea?
>
> Because if you install your project, modwsgi will say:
>
> Import myapp
>
> If you installed the project aka you put it in site-packages it will
> try to import the file from site-packages folder.
> Since apache needs its user be the owner of the myapp, then that means
> your site package needs to be also owned by apache user. I think on
> linux the site-package folder is owned by root.

Ah, ok. Yes, site-packages is owned by root but that doesn't seem to
be a problem as long as I move any data directories (e.g. database and
cache directory) to a different location (in my case /var) that is
writable by Apache user. All of the python code in site-packages is
readable by Apache. So my tests so far are ok.

>
> Another issue is that you might have 2 versions. One installed in
> site-packages and another one that you think its running from.

Indeed. I have dealt with this problem by creating a symbolic link
from (e.g.) /usr/local/turbogears/myapp --> site-packages/
MyApp-0.1.egg/ . The upgrade script (which will do easy_install -U)
will also have to update this symlink (can probably use pkg_resources
or one of those utilities to determine which is the latest version and
update the symlink).

>
> Does that answer your question.

Yes, thanks a lot. I just wanted to make sure that I wasn't missing
something specific in modwsgi that made site-packages a very bad idea.

Cheers,
David
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" 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/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to