CSS belongs under static. Packages and common routines belong under modules 
and are "import"ed. You could have a common static and modules and 
symbolically link. I have never done that, but it makes sense.

I suppose you could also put the CSS just about anywhere on the file 
system. And modules could be put under the python package library and 
imported from there. I haven't tried that, but seems like it would work.

On Friday, August 17, 2012 11:57:02 AM UTC+8, curiouslearn wrote:
>
> Hello,
>
> What is the recommended place in web2py folder where I should store custom 
> functions that are useful to multiple applications? For example, suppose I 
> have a function such as the following:
>
> *def connecttodb():*
> *    if request.is_local:*
> *        user="user"*
> *        passwd="passed"*
> *        host="localhost"*
> *    else:*
> *        user="user_nonlocal"*
> *        passwd="passwd_nonlocal"*
> *        host="nonlocalhost"*
> *    con = mdb.connect(user=user,*
> *                      passwd=passwd,*
> *                      host=host)*
> *    c = con.cursor()*
> *    return con, c*
>
>
>  I will need this in every application. Further, if I decide to change the 
> host, I have to go and change the values in every application. There are 
> other useful functions common to all applications. Can I just store them in 
> one folder and import them, so that they work both on local and web hosts? 
> If so, where do you recommend I save them?
>
> Thank you.
>

-- 



Reply via email to