Is there a way to place apps in a separate directory from the "applications" directory?

10 views
Skip to first unread message

cesmiga

unread,
May 27, 2009, 9:55:39 AM5/27/09
to web2py Web Framework
All:

I've been looking around and was wondering if there is a way to place
apps in a separate directory from the "applications" directory?

From:
/opt/web2py/applications

To:
/opt/web2py_apps

Thank you,
Christopher

virhilo

unread,
May 27, 2009, 10:01:32 AM5/27/09
to web2py Web Framework
ln -s /opt/web2py_apps /opt/web2py/applications/

cesmiga

unread,
May 27, 2009, 10:33:47 AM5/27/09
to web2py Web Framework
Virhilo,

I was thinking about this approach, but was hoping for a more
customizable method via web2py. Is there another way to do this aside
from a sym link?

Christopher

Kuba Kucharski

unread,
May 27, 2009, 10:37:34 AM5/27/09
to web...@googlegroups.com
What is the purpose? could you explain more?

--
Kuba

cesmiga

unread,
May 27, 2009, 11:02:49 AM5/27/09
to web2py Web Framework
Kuba,

The reason is to separate Web2Py from developed applications. The same
idea is usually done with databases. Separate the data (in this case
Web2Py apps) from the application (Web2Py). This should ease with
upgrades and other administration/development tasks.

Christopher

Kuba Kucharski

unread,
May 27, 2009, 11:24:25 AM5/27/09
to web...@googlegroups.com

unix thinking;)

Let's say we would have solution for this. That means that 'the path' should be placed in a configuration outside 'applications'.. and outside web2py folder(since you need to do upgrades etc..). This means we should also have some standard place for configuration.. /etc..?:)

This leads to a problem. Web2py is multiplatform. That is why symlink is a pretty good solution.

Also you can safely unpack your new version of web2py on a existing one. Finally, you can just copy applications' folders to a new one. A lot of solutions.  I understand your point of view but..

--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subs...

cesmiga

unread,
May 27, 2009, 11:24:34 AM5/27/09
to web2py Web Framework
Ok! I've been thinking about some of the things we discussed in this
thread and it must remain simple. I'll stick with the sym link idea
since anything else is more complex. After all, the reason we love
"Web2Py" is because development practice utilizes the KIS (Keep It
Simple) method.

Thanks for all your support and thoughts. I hope I didn't take too
much time from anyone since I was trying to make it more complicated
than I should have.

I'll smack my own hand for this one. ;-)

Thanks again,
Christopher

Saber Rastikerdar

unread,
May 27, 2009, 5:47:10 PM5/27/09
to web2py Web Framework
hi.

i'm thinking of local user applications in ~/.exapp.
suppose that main application runs in every user session and can load
apps in their home directory.
can we dynamically set applications directory? i mean having multiple
application directories.

sorry i don't want to make things complex. just asking for a new
project i want to begin!

Eddie Eyles

unread,
May 27, 2009, 9:59:10 PM5/27/09
to web2py Web Framework
I think Christopher and Saber have good points here. Any application
should be flexible about where its data is stored. There are many
good potential reasons for wanting to separate the respective
locations of application and data. The symbolic link solution, while
offering just a little flexibility in this for Linux users, is not
available on pre-Vista Windows without installing additional, somewhat
dubious software.

It seems to come down to web2py needing to have some new configuration
data that tells it where its data (i.e. its applications) are
installed. It is not too difficult to imagine a configuration file
(living in the applications directory, perhaps) that simply lists
other directories that web2py is to regard as application
directories. The create/upload/uninstall functions for managing
applications would need to be enhanced to read and write this file.
The default could remain that applications are found in web2py's
applications directory.

Saber's ideas could extend this concept by allowing lines like his
~/.exapp in the configuration file. This could be either the name of
an applications directory that exists in every user's home directory,
or, more flexibly, the name of a further configuration file for each
user that lists the locations of the application directories for that
user. I don't know whether this would fit or conflict with other
ideas that I think I've seen floating around, for a CMS built in to
web2py.

Eddie

Iceberg

unread,
May 28, 2009, 4:38:18 AM5/28/09
to web2py Web Framework
On May28, 9:59am, Eddie Eyles <ho...@heddonsgate.co.uk> wrote:
> It seems to come down to web2py needing to have some new configuration
> data that tells it where its data (i.e. its applications) are
> installed.  It is not too difficult to imagine a configuration file
> (living in the applications directory, perhaps) that simply lists
> other directories that web2py is to regard as application
> directories.  The create/upload/uninstall functions for managing
> applications would need to be enhanced to read and write this file.
> The default could remain that applications are found in web2py's
> applications directory.
>
> Eddie


+1 for Eddie's idea.

Currently I just feel boring enough to do all below steps when I
upgrade to a newer version of web2py_win.zip
1. Move all web2py/applications/myapp_* into c:\temp
2. Delete the current "web2py" directory
3. Unzip the new web2py_win.zip into "web2py" directory and start it.
4. Move back all my apps from c:\temp to web2py/applications

With Eddie's idea, I can skip step 1 & 4, just unzip the new
web2py_*.zip, and do something like:
web2py -a blah -L myconfig.ini
or just:
web2py -a blah --APP_PATH c:\my_app_repo

Of course, the configure file is optional, therefore the official "Has
no configuration files. You just unzip it and click on it" slogan
remains true.

Kuba Kucharski

unread,
May 28, 2009, 6:06:57 AM5/28/09
to web...@googlegroups.com
What about doing only point "3." with "REPLACE ALL" option? It works,
all your applications remain safe.


Regards
--
Kuba

Iceberg

unread,
May 28, 2009, 6:45:57 AM5/28/09
to web2py Web Framework
> Kuba


Sorry but did you mean web2py already has a "REPLACE ALL" app option?
I didn't know that. Could you teach me more?

Kuba Kucharski

unread,
May 28, 2009, 7:34:37 AM5/28/09
to web...@googlegroups.com

Hi

I ain't no teacher :)
I ment 'replace all' when unzipping.. than you upgrade admin app and should be ok?

On May 28, 2009 12:48 PM, "Iceberg" <ice...@21cn.com> wrote:

On May28, 6:06pm, Kuba Kucharski <kuba.kuchar...@gmail.com> wrote: > What about doing only point "3...

Sorry but did you mean web2py already has a "REPLACE ALL" app option?
I didn't know that. Could you teach me more?

--~--~---------~--~----~------------~-------~--~----~ You received this message because you are sub...

Iceberg

unread,
May 28, 2009, 8:27:56 AM5/28/09
to web2py Web Framework
Got your points now. :-)

Sure an "unzip and replace all" would work in most cases, and as you
mentioned, one more extra step is needed to upgrade the admin app (can
be done by an "web2py.py -u yes" although it halts at the end).

I can live with this approach. Yet I have to say, as a picky guy, I
still think it sounds a little dangerous to do an "unzip and replace
all" operation on a directory in which contains my precious app codes.
My heartbeat just rise to 120+ beats per minute when I did above
test. :-) It would be better if web2py can support loading other apps
from a separated app directory.

On May28, 7:34pm, Kuba Kucharski <kuba.kuchar...@gmail.com> wrote:
> Hi
>
> I ain't no teacher :)
> I ment 'replace all' when unzipping.. than you upgrade admin app and should
> be ok?
>

mdipierro

unread,
May 28, 2009, 9:45:37 AM5/28/09
to web2py Web Framework
If you unzip new web2py over old web2py it DOES NOT interfere with
apps nor routes.
If you want to upgrade admin, wecome and examples you should run the
new web2py once with

web2py.pt --upgrade=yes

Massimo

Richard

unread,
Jul 15, 2009, 6:49:26 PM7/15/09
to web2py Web Framework
a note on upgrading:
> python web2py.py -h
...
-u UPGRADE, --upgrade=UPGRADE upgrade
applications

The doc string says --upgrade=UPGRADE but this doesn't work. You have
to use --upgrade=yes.
Richard


On May 28, 11:45 pm, mdipierro <mdipie...@cs.depaul.edu> wrote:
> If you unzip new web2py over old web2py it DOES NOT interfere with
> apps nor routes.
> If you want toupgradeadmin, wecome and examples you should run the
> new web2py once with
>
> web2py.pt --upgrade=yes
>
> Massimo
>
> On May 28, 7:27 am, Iceberg <iceb...@21cn.com> wrote:
>
> > Got your points now. :-)
>
> > Sure an "unzip and replace all" would work in most cases, and as you
> > mentioned, one more extra step is needed toupgradetheadminapp (can
> > be done by an "web2py.py -u yes" although it halts at the end).
>
> > I can live with this approach. Yet I have to say, as a picky guy, I
> > still think it sounds a little dangerous to do an "unzip and replace
> > all" operation on a directory in which contains my precious app codes.
> > My heartbeat just rise to 120+ beats per minute when I did above
> > test. :-)  It would be better if web2py can support loading other apps
> > from a separated app directory.
>
> > On May28, 7:34pm, Kuba Kucharski <kuba.kuchar...@gmail.com> wrote:
>
> > > Hi
>
> > > I ain't no teacher :)
> > > I ment 'replace all' when unzipping.. than youupgradeadminapp and should

Richard

unread,
Jul 15, 2009, 6:51:23 PM7/15/09
to web2py Web Framework
whoops - this was just reported in another thread!
Reply all
Reply to author
Forward
0 new messages