On Thursday, January 28, 2016 at 10:21:54 AM UTC-8, Anthony wrote: > > On Thursday, January 28, 2016 at 2:37:47 AM UTC-5, Brendan Barnwell wrote: >> >> Yes, I realize I can do that. The problem is that (if I understand >> right) unless I put it in the web2py folder, web2py won't know about it. >> > > I'm not sure I follow. If you realize you can leave your application > folder inside /web2py/applications and simply create a version control > repository right there, then why is it a "problem" that it must be inside > the web2p folder? > Basically because my web2py application is only one part of a larger project, other parts of which have nothing to do with web2py. (I write web apps for use as online experiments/surveys. The app collects the data, but the analysis is done offline, and then other things are done with that data/analysis that are unconnected with the web2py app that was used to collect it.) What I want is to have a directory for that project, and a subdirectory within that for the web2py app. But I can't do that now without symlinking my subdirectory into the web2py folder.
> I can symlink it (or directory-junction it, in windows), but that still >> seems quite awkward to me. I feel like it would make more sense if the >> information about where web2py looks for applications was part of web2py's >> own configuration, not so closely tied to the directory structure on disk. >> > > Well, you can already move the entire /applications folder somewhere else. > And you can also create a separate version control repository for each > application within the /applications folder. What additional benefit do you > get by moving each application folder to some arbitrary place in the > filesystem? In the rare cases where that is necessary, you can always use > existing OS facilities, such as symlinking. > > I suppose we could allow further configuration, but that would add > complexity to the routing system and the functioning of the admin app. We > tend to avoid additional complexity unless there is a compelling benefit. > It's hard to see the compelling benefit here. > The compelling benefit I see is that it enables a web2py app to be one part of a larger project, rather than forcing that entire project to be stuffed under the web2py directory. Symlinking is a sort-of solution, but on Windows symlinking is not as simple as it might sound. (As indicated in the other thread I linked to, you have to create a "directory junction", which is different than an ordinary file link.) Also, symlinking raises the possibility that other filesystem operations I might do in the future will unexpectedly recurse into the linked directory. I don't want my directory to act as if it were in the web2py directory in general, just for web2py's own internal purposes, which is why I say I think it makes more sense for this to be part of web2py config rather than filesystem-level things like symlinks. I see this situation as analogous to how Python libraries work. Normally, when you install a library, it gets put under site-packages. But if you want, you can put the library somewhere else, and use a .PTH file (which you put in site-packages) to tell Python where to find the library. This is for instance how pip editable installs work. Of course the "normal" situation is to install the library directly in site-packages, but there are many situations where for whatever reason (e.g., development) you don't want to do that. Python doesn't handle this by relying on OS-level symlinking; it has its own system (.PTH files) that allows you to tell Python where your libraries are independent of where they are in the filesystem. I think that flexibility would be valuable in web2py as well. Anyway, thanks for your continued dialogue with me on this. Web2py does seem really cool and I think I can make it work for me for the time being. I'm mainly raising this question with an eye down the road to future projects I might do with it, where I foresee it might become unwieldy to handle as I have more and more of these projects of which a web2py app is only one piece. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.