[web2py] Re: Py4web: ¿Practical example step by step?

2020-01-21 Thread Massimo Di Pierro
I am preparing one. It will be done in 2 weeks. Promise.

On Tuesday, 21 January 2020 01:15:27 UTC-8, Dave S wrote:
>
>
>
> On Monday, January 20, 2020 at 4:55:33 AM UTC-8, Yuver Parra wrote:
>>
>>
>> Good morning and thanks in advance for sharing your knowledge in this 
>> group.
>> Do any of you have a practical example where you can follow step by step 
>> learning from the installation of py4web to the setting up of a site?
>>
>> Thanks for the reply.
>>
>
> When posting a new euqestion, please don't check "show at the top" --- 
> save that for messages that need to be displayed long-term,
> like etiquette or policy.
>
> Have you looked at README.md at
> https://github.com/web2py/py4web> ?
>
> This should make a small stand-alone server and one or more sample 
> applications.
>
> If you have looked at that introduction, what questions do you still have?
>
> Also, look at the py4web documentation at
> 
>
> I haven't heard of any training videos yet (the older framework, web2py, 
> has several, but those wouldn't be useful for py4web).
>
> If you need to learn more about setting up a front-end server, such as 
> NginX, you should consult the NginX website.  
> (the web2py position on Apache is that if you don't have it already, you 
> should consider NginX or other easier-to-use front ends.)
>
> Good luck!
>
> /dps
>
>
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/6f2ff50a-354d-492f-8929-54eb8dc7a48c%40googlegroups.com.


Re: [web2py] py4web questions

2020-01-21 Thread Massimo Di Pierro
See my answer 

https://groups.google.com/d/msg/web2py/cgg6M7B_wkI/lWd-Ytt3DQAJ

On Monday, 20 January 2020 22:55:28 UTC-8, Bruno Sarverry wrote:
>
> Hello John! did you solve it? I have the same problem.
>
> El jueves, 26 de septiembre de 2019, 6:05:52 (UTC-3), John Bannister 
> escribió:
>>
>> Hi  Massimo, 
>>
>> Have one more question which may or may not be related. 
>>
>> I have multiple controllers all including the same layout.html. In the 
>> layout.html the navbar should display the user logged in (or not). I see in 
>> the _scaffold app the login menu is created using globals().get('user') 
>> which works fine if we are returning the user=auth.get_user() to the 
>> template.
>>
>> Question is do I need to return user=auth.get_user() from each action or 
>> is there some way of accessing the user/login information from the 
>> templates and in particular layout.html? 
>>
>> And one more which is how to deal with images in py4web? I have tried to 
>> upload an image using field of type upload using standard Form. When I look 
>> at the record again or try to edit it says no image selected. Guess there 
>> is the equivalent of download missing somewhere. Any help appreciated.
>>
>> John 
>> -Original Message- 
>> From: web...@googlegroups.com [mailto:web...@googlegroups.com] On Behalf 
>> Of Massimo Di Pierro 
>> Sent: 26 September 2019 09:02 
>> To: web2py-users 
>> Subject: [web2py] py4web questions 
>>
>> Good question. I will try post a tutorial in the next few days. But the 
>> idea is you associate tags to a user and then give permissions based on the 
>> tags. The tag API is very simple so I recommend you meanwhile look at the 
>> source. 
>>
>> -- 
>> 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 web...@googlegroups.com. 
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/web2py/b6009627-7b67-405f-a98e-1dbcb5dbb1e2%40googlegroups.com.
>>  
>>
>>
>>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/b594d875-42fd-48c1-bd38-6c42e316ed14%40googlegroups.com.


[web2py] Re: Looking for web2py developer for Italian small company

2020-01-21 Thread Massimo Di Pierro
I strongly recommend py4web + vue.js :-)

On Tuesday, 21 January 2020 07:40:18 UTC-8, Ivan Gazzola wrote:

> We are a small company in Italy, we need a new developer for our project (
> xortho.it)
>
> The web app is developed with jquery mobile and web2py, we are planning to 
> move to angular and web2py or better py4web.
>  
> If you're interested please contact us.
>
> Ciao
>
> Ivan
>
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/fc6ea910-acbb-45b7-9553-2e33152d2863%40googlegroups.com.


[web2py] Re: py4web - form field default - appears to not be working for me

2020-01-21 Thread Massimo Di Pierro
can you try this?

form = Form()
if not form.submitted: form.vars.update({field.name:field.default for field 
in form.table if field.default})

Maybe I can make this default behavior?

On Tuesday, 21 January 2020 18:27:02 UTC-8, Jim S wrote:
>
> Sorry for all the py4web noob questions
>
> I have the following:
>
> search_text = 'test'
> form = Form([Field('search',
>length=50,
>default=search_text)],
> form_name='search_form',
> formstyle=FormStyleBulma,
> keep_values=True)
>
> I can't get the default search_text to appear in the field.  
>
> Anything obvious I'm missing?
>
> -Jim
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/e9ea15c4-d6a4-44de-a13b-d54e2d0e606c%40googlegroups.com.


Re: [web2py] py4web - using session object in a template

2020-01-21 Thread Massimo Di Pierro
Lazy is good. You can turn it to your advantage with this:

import functools
def my_awesome_decorator(path=None, method=['GET','POST'], 
requires_login=False):
def wrapper(func, path=path, method=method, 
requires_login=requires_login):
path = path or func.__name__
template = func.__name__+'.html'
fixtures = [template, db, session, auth]
if requires_login: fixtures.append(auth.user)
@action(path, method=method)
@action.uses(*fixtures)
@functools.wraps(func)
def tmp(*a, **b):
d = func(*a, **b)
if isinstance(d, dict):
 d['session'] = dict(session.local.data)
 if requires_login: d['user'] = auth.get_user()
return d
return tmp
return wrapper

@my_awesome_decorator('test')
def index():
return {}



On Tuesday, 21 January 2020 05:39:51 UTC-8, Jim S wrote:
>
> Thanks Massimo.  I was hoping to avoid having to pass something to the 
> view every time.  I'm lazy, right?  I'm assuming that this is the same if I 
> used response instead of session.  In web2py you didn't have to pass 
> response to the view, it was automatically available.
>
> -Jim
>
> On Tue, Jan 21, 2020 at 1:00 AM Massimo Di Pierro <
> massimo.dipie...@gmail.com> wrote:
>
>> I would recommend you do something like this
>>
>> @action('index')
>> @action.uses('index.html', session)
>> def index():
>> ...
>> return dict(session=dict(session))
>>
>> This will pass a shallow copy of the session to the view. You will be 
>> free to read from the session in index.html but you should not write it.
>>
>>
>>
>> On Friday, 17 January 2020 12:34:43 UTC-8, Jim S wrote:
>>>
>>> I should re-state my problem.  With web2py I wasn't using session, but 
>>> response.  I added a couple of attributes that always got added to the 
>>> response object.  Not sure how to mimic that in py4web, or would I even 
>>> want to?
>>>
>>> -Jim
>>>
>>> On Fri, Jan 17, 2020 at 11:16 AM Jim S  wrote:
>>>
 Hi

 I'm trying to pass a session variable to layout.html but it tells me 
 that session is not available:

 NameError: name 'session' is not defined

 I use this technique in web2py to send a page title to layout.html 
 without having to pass it in the returned dict from the controller.

 Obviously I'm being lazy using this technique.  Will this work with 
 py4web or is it best for me to pass in explicitly in each controller?

 -Jim

 -- 
 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 a topic in the 
 Google Groups "web2py-users" group.
 To unsubscribe from this topic, visit 
 https://groups.google.com/d/topic/web2py/cgg6M7B_wkI/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to 
 web2py+unsubscr...@googlegroups.com.
 To view this discussion on the web visit 
 https://groups.google.com/d/msgid/web2py/8848279b-e889-4b9b-90a6-664813a47b89%40googlegroups.com
  
 
 .

>>> -- 
>> 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 a topic in the 
>> Google Groups "web2py-users" group.
>> To unsubscribe from this topic, visit 
>> https://groups.google.com/d/topic/web2py/cgg6M7B_wkI/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to 
>> web2py+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/web2py/06f7bcfe-4a9f-42a0-a5ec-a686edf6513e%40googlegroups.com
>>  
>> 
>> .
>>
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/db45f1c5-81de-44ce-b75e-fea9116920b9%40googlegroups.com.


Re: [web2py] py4web - using session object in a template

2020-01-21 Thread Massimo Di Pierro
Lazy is good. You can turn it to your advantage with this:

import functools
def my_awesome_validator(path=None, method=['GET','POST'], 
requires_login=False):
def wrapper(func, path=path, method=method):
path = path or func.__name__
template = func.__name__+'.html'
fixtures = [template, db, session, auth]
if requires_login: fixtures.append(auth.user)
@action(path, method=method)
@action.uses(*fixtures)
@functools.wraps(func)
def tmp(*a, **b):
d = func(*a, **b)
if isinstance(d, dict): d['session'] = dict(session.local.data)
return d
return tmp
return wrapper

@my_awesome_validator('test')
def index():
return locals()



On Tuesday, 21 January 2020 05:39:51 UTC-8, Jim S wrote:
>
> Thanks Massimo.  I was hoping to avoid having to pass something to the 
> view every time.  I'm lazy, right?  I'm assuming that this is the same if I 
> used response instead of session.  In web2py you didn't have to pass 
> response to the view, it was automatically available.
>
> -Jim
>
> On Tue, Jan 21, 2020 at 1:00 AM Massimo Di Pierro <
> massimo.dipie...@gmail.com> wrote:
>
>> I would recommend you do something like this
>>
>> @action('index')
>> @action.uses('index.html', session)
>> def index():
>> ...
>> return dict(session=dict(session))
>>
>> This will pass a shallow copy of the session to the view. You will be 
>> free to read from the session in index.html but you should not write it.
>>
>>
>>
>> On Friday, 17 January 2020 12:34:43 UTC-8, Jim S wrote:
>>>
>>> I should re-state my problem.  With web2py I wasn't using session, but 
>>> response.  I added a couple of attributes that always got added to the 
>>> response object.  Not sure how to mimic that in py4web, or would I even 
>>> want to?
>>>
>>> -Jim
>>>
>>> On Fri, Jan 17, 2020 at 11:16 AM Jim S  wrote:
>>>
 Hi

 I'm trying to pass a session variable to layout.html but it tells me 
 that session is not available:

 NameError: name 'session' is not defined

 I use this technique in web2py to send a page title to layout.html 
 without having to pass it in the returned dict from the controller.

 Obviously I'm being lazy using this technique.  Will this work with 
 py4web or is it best for me to pass in explicitly in each controller?

 -Jim

 -- 
 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 a topic in the 
 Google Groups "web2py-users" group.
 To unsubscribe from this topic, visit 
 https://groups.google.com/d/topic/web2py/cgg6M7B_wkI/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to 
 web2py+unsubscr...@googlegroups.com.
 To view this discussion on the web visit 
 https://groups.google.com/d/msgid/web2py/8848279b-e889-4b9b-90a6-664813a47b89%40googlegroups.com
  
 
 .

>>> -- 
>> 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 a topic in the 
>> Google Groups "web2py-users" group.
>> To unsubscribe from this topic, visit 
>> https://groups.google.com/d/topic/web2py/cgg6M7B_wkI/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to 
>> web2py+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/web2py/06f7bcfe-4a9f-42a0-a5ec-a686edf6513e%40googlegroups.com
>>  
>> 
>> .
>>
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/0a522553-0a4c-4404-94c7-bf264f026f34%40googlegroups.com.


[web2py] Re: Is there a working bootstrap3 formstyle for auth?

2020-01-21 Thread Alexander Hoch

Thx, that solved my problem after I reloaded my old web2py app.
When generating SQLFORM an error "Formstyle not supported occurs".
I added 
[forms]
formstyle = bootstrap4_inline
separator =
 to appconfig.ini 
and it works. 

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/dcd7eb71-d685-4ce7-b586-06dd6991e023%40googlegroups.com.


Re: [web2py] Looking for web2py developer for Italian small company

2020-01-21 Thread Hugo Alberto Rivera Diaz
I'm interested! 2 years of experience in jquery and web2py and still
working with them! contact me!

El mar., 21 ene. 2020 a las 9:40, Ivan Gazzola ()
escribió:

> We are a small company in Italy, we need a new developer for our project (
> xortho.it)
>
> The web app is developed with jquery mobile and web2py, we are planning to
> move to angular and web2py or better py4web.
>
> If you're interested please contact us.
>
> Ciao
>
> Ivan
>
> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/web2py/9b87d283-adc7-4fbb-830a-8f3a3a45eddf%40googlegroups.com
> 
> .
>


-- 
  * Saludos!*
   *Hugo Alberto Rivera Diaz* 

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/CAMDsM77S6-cY%3DqNxXy%3DzeiB5KzcP9WrtSCrroJ96aniumjwpkg%40mail.gmail.com.


[web2py] py4web - form field default - appears to not be working for me

2020-01-21 Thread Jim S
Sorry for all the py4web noob questions

I have the following:

search_text = 'test'
form = Form([Field('search',
   length=50,
   default=search_text)],
form_name='search_form',
formstyle=FormStyleBulma,
keep_values=True)

I can't get the default search_text to appear in the field.  

Anything obvious I'm missing?

-Jim

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/38721f9b-bf73-47be-bb3d-0d6396cc2281%40googlegroups.com.


[web2py] Varying membership

2020-01-21 Thread Aydin
I have a bunch of accounts in web2py and I want to create for each a group 
that additional users could access those accounts. For example, account 1 
has a group id 1 and now I want to add additional users to this group. The 
problem I have is how can I use this group id to authorize. Meaning that 
when I use @auth.requires_membership(group_id = i) for the same function, i 
is something that varies. Maybe there is a much better way you can suggest 
for this need?

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/fe549c19-7c01-4999-a7c4-b560fa6a4d46%40googlegroups.com.


[web2py] py4web - name of form - add classes to form

2020-01-21 Thread Jim S
I'm using Form from:

from py4web.utils.form import Form

I want to add some classes to the  tag that is generated.  In web2py 
I can add _class='field is-horizontal' when creating the instance and the 
classes will be passed along.

Optionally I could add some css/javascript that could modify the classes.  
However, then I need to be able to reference the form.  I assumed I could 
do that with the form_name argument, but that doesn't add a name or id to 
the form element.  It is used on some of the children, but not on the form 
itself.

How can I add classes to the form and to the elements inside the form?

-Jim

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/fe01bcb5-4b4d-40a7-9974-6aa0a95dae48%40googlegroups.com.


[web2py] Re: py4web - method not allowed

2020-01-21 Thread Jim S
Thank you again.  Yes, that fixed it.

-Jim

On Tuesday, January 21, 2020 at 12:29:04 PM UTC-6, Val K wrote:
>
> It seems that your pydal is out of date, try to update it

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/4d56e707-6fe1-455a-8e17-9d22f9d660cd%40googlegroups.com.


[web2py] Re: py4web - method not allowed

2020-01-21 Thread Val K
It seems that your pydal is out of date, try to update it

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/a671bb86-e894-4eeb-b012-8fc40cbc0fc4%40googlegroups.com.


Re: [web2py] Looking for web2py developer for Italian small company

2020-01-21 Thread Geordanis Baño Vega
Hi, i am interested.

El mar., 21 ene. 2020 a las 10:40, Ivan Gazzola ()
escribió:

> We are a small company in Italy, we need a new developer for our project (
> xortho.it)
>
> The web app is developed with jquery mobile and web2py, we are planning to
> move to angular and web2py or better py4web.
>
> If you're interested please contact us.
>
> Ciao
>
> Ivan
>
> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/web2py/9b87d283-adc7-4fbb-830a-8f3a3a45eddf%40googlegroups.com
> 
> .
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/CAA4GC_uQwY0jDXjzXvu7yXnHntpKnr7GEbB0yw73hC0wDtrUHQ%40mail.gmail.com.


[web2py] Re: py4web - method not allowed

2020-01-21 Thread Jim S
Thank you, that did the trick.

Now however, I'm getting this traceback:
ERROR:root:Traceback (most recent call last):
  File "/home/jim/.local/lib/python3.7/site-packages/py4web/core.py", line 
543, in wrapper
ret = func(*func_args, **func_kwargs)
  File "/home/jim/.local/lib/python3.7/site-packages/py4web/core.py", line 
503, in wrapper
ret = func(*args, **kwargs)
  File "apps/py4web_test/controllers/administration.py", line 27, in links
form = Form([Field('search', length=50)], formstyle=FormStyleBulma)
  File "/home/jim/.local/lib/python3.7/site-packages/py4web/utils/form.py", 
line 241, in __init__
(value, error) = field.validate(value, record_id)
TypeError: validate() takes 2 positional arguments but 3 were given

Controller code is exactly the same as above.

-Jim

On Tuesday, January 21, 2020 at 11:21:44 AM UTC-6, Val K wrote:
>
> Try method=... instead of methodS

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/064cc213-05da-4432-ae06-95315ee2ee43%40googlegroups.com.


[web2py] py4web - method not allowed

2020-01-21 Thread Val K
Try method=... instead of methodS

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/0cf7cd8e-645b-4473-bd81-fb1d2d3263a9%40googlegroups.com.


[web2py] Re: table.insert(**mydict) returns Field auth_user does not belong to the table

2020-01-21 Thread António Ramos
wrong Table!!
Thank you!!

Em ter., 21 de jan. de 2020 às 16:57, António Ramos 
escreveu:

> Hello this is my model and code. Apparently all is ok but i get the error
> *Field auth_user does not belong to the table*
> *any help ???*
>
>
> *Code and model*
> mydict={"event":"testing testing",*auth_user:4*}
>
> db.entities.insert(**mydict)
>
> db.define_table(
> 'events',
> Field('event', 'text'),
> Field('auth_user', db.auth_user,default=auth.user_id),
> ...
>
> )
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/CAEM0BxMmeLi8OMpfjQD_Q6mZhz3jrTJwrYw9WuZZ4-yAoToDPw%40mail.gmail.com.


[web2py] table.insert(**mydict) returns Field auth_user does not belong to the table

2020-01-21 Thread António Ramos
Hello this is my model and code. Apparently all is ok but i get the error
*Field auth_user does not belong to the table*
*any help ???*


*Code and model*
mydict={"event":"testing testing",*auth_user:4*}

db.entities.insert(**mydict)

db.define_table(
'events',
Field('event', 'text'),
Field('auth_user', db.auth_user,default=auth.user_id),
...

)

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/CAEM0BxOY3AAc96kWQzk1maS74W1WXwc61e%3D3WVegbxmGFy20qA%40mail.gmail.com.


[web2py] Looking for web2py developer for Italian small company

2020-01-21 Thread Ivan Gazzola
We are a small company in Italy, we need a new developer for our project 
(xortho.it)

The web app is developed with jquery mobile and web2py, we are planning to 
move to angular and web2py or better py4web.
 
If you're interested please contact us.

Ciao

Ivan

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/9b87d283-adc7-4fbb-830a-8f3a3a45eddf%40googlegroups.com.


Re: [web2py] Re: running two web2py instances on the same server under apache wsgi mod

2020-01-21 Thread Manuele Pesenti

On 21/01/20 15:10, Manuele Pesenti wrote:

So I guess I have to try using the second web2py (R-2.18 under python3 
virtualenv) instance through mod_proxy... right?


So I'm trying to run a web2py (R-2.18.3) instance for deploy purposes 
using apache mod_proxy.


First I want to install the necessary daemon... I'm following the 
documentation[1] but without success,
it seams the daemon is not running after starting it. How can I log 
errors? I cannot find them, this are the only information I have found:


   # service web2py218 stop
   # service web2py218 start
   # service web2py218 status
   ● web2py218.service - LSB: web2py initscript
   Loaded: loaded (/etc/init.d/web2py218; generated)
   Active: active (exited) since Tue 2020-01-21 16:20:46 CET; 3s ago
 Docs: man:systemd-sysv-generator(8)
  Process: 31480 ExecStop=/etc/init.d/web2py218 stop (code=exited,
   status=1/FAILURE)
  Process: 31514 ExecStart=/etc/init.d/web2py218 start
   (code=exited, status=0/SUCCESS)

   Jan 21 16:20:46 Ubuntu-1804-bionic-64-nextcloud systemd[1]: Starting
   LSB: web2py initscript...
   Jan 21 16:20:46 Ubuntu-1804-bionic-64-nextcloud web2py218[31514]:  *
   Starting Web Framework web2py218
   Jan 21 16:20:46 Ubuntu-1804-bionic-64-nextcloud web2py218[31514]:   
   ...done.
   Jan 21 16:20:46 Ubuntu-1804-bionic-64-nextcloud systemd[1]: Started
   LSB: web2py initscript.

When I try to access the web2py instance through ssh tunneling it says:

   channel 3: open failed: connect failed: Connection refused

Looking in syslog I read:

   # tail /var/log/syslog
   Jan 21 16:20:41 Ubuntu-1804-bionic-64-nextcloud web2py218[31480]:  *
   Stopping Web Framework web2py218
   Jan 21 16:20:41 Ubuntu-1804-bionic-64-nextcloud web2py218[31480]:
   start-stop-daemon: warning: failed to kill 31269: No such process
   Jan 21 16:20:41 Ubuntu-1804-bionic-64-nextcloud web2py218[31480]:   
   ...done.
   Jan 21 16:20:41 Ubuntu-1804-bionic-64-nextcloud systemd[1]:
   web2py218.service: Control process exited, code=exited status=1
   Jan 21 16:20:41 Ubuntu-1804-bionic-64-nextcloud systemd[1]:
   web2py218.service: Failed with result 'exit-code'.
   Jan 21 16:20:41 Ubuntu-1804-bionic-64-nextcloud systemd[1]: Stopped
   LSB: web2py initscript.
   Jan 21 16:20:46 Ubuntu-1804-bionic-64-nextcloud systemd[1]: Starting
   LSB: web2py initscript...
   Jan 21 16:20:46 Ubuntu-1804-bionic-64-nextcloud web2py218[31514]:  *
   Starting Web Framework web2py218
   Jan 21 16:20:46 Ubuntu-1804-bionic-64-nextcloud web2py218[31514]:   
   ...done.
   Jan 21 16:20:46 Ubuntu-1804-bionic-64-nextcloud systemd[1]: Started
   LSB: web2py initscript.

This is my script version: http://paste.debian.net/hidden/e3917c71/

Thank you for any help.

Best regards

    Manuele

[1] 
http://web2py.com/books/default/chapter/29/13/deployment-recipes#Start-as-Linux-daemon


--
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/21c4ff49-b8a3-f41f-0891-b60ba855af00%40gmail.com.


Re: [web2py] Re: running two web2py instances on the same server under apache wsgi mod

2020-01-21 Thread Manuele Pesenti



On 21/01/20 14:59, Manuele Pesenti wrote:

Thank you Tim,

I tried but restarting apache and accessing the instance the browser 
takes a long time to respond and I get this error in log:


ImportError: No module named site


Could it be related to this https://stackoverflow.com/a/41006418/1039510 ?


> When using a Python virtual environment with mod_wsgi, it is very 
important that it has been created using the same Python installation 
that mod_wsgi was originally compiled for. It is not possible to use a 
Python virtual environment to force mod_wsgi to use a different Python 
version, or even a different Python installation.

>
> You cannot for example force mod_wsgi to use a Python virtual 
environment created using Python 3.5 when mod_wsgi was originally 
compiled for Python 2.7. This is because the Python library for the 
Python installation it was originally compiled against is linked 
directly into the mod_wsgi module.

>
> So most likely what is happening is that mod_wsgi is compiled for 
Python 2.6. You cannot in this case force it to use a Python virtual 
environment created from Python 2.7. When you do this, you will get the 
error you see about site module being missing.


So I guess I have to try using the second web2py (R-2.18 under python3 
virtualenv) instance through mod_proxy... right?


Cheers

    Manuele

--
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/e22744f7-e25b-3991-1040-dfb937802d2d%40gmail.com.


[web2py] py4web - method not allowed

2020-01-21 Thread Jim S
I'm getting the following when I click on the submit button on my form:

Error: 405 Method Not Allowed

Sorry, the requested URL 
'http://127.0.0.1:8000/py4web_test/administration/links' caused an error:

Method not allowed.

My controller code:

@action('administration/links', methods=['GET', 'POST'])
@action.uses('grid.html', session, db, auth.user)
def links():
url_path = 'administration/links'
page['sub_title'] = A('LINKS', _href=URL(url_path))

form = Form([Field('search', length=50)], formstyle=FormStyleBulma)

query = db.link.id > 0
fields = [db.link.id, db.link.name, db.link.table_name, db.link.
permission_name, db.link.method]

grid = Grid(url_path, query, fields=fields,
search_form=form,
create_url=URL('administration/link/0'),
edit_url=URL('administration/link'),
delete_url=URL('administration/link/delete'))

return dict(page=page, grid=grid, form=form)

I'm guessing there is something obvious I'm missing.  Can anyone see it?  
Any help would be appreciated.

-Jim


-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/49338241-2ca3-4068-9b2a-dde4d95a0bfe%40googlegroups.com.


Re: [web2py] Re: running two web2py instances on the same server under apache wsgi mod

2020-01-21 Thread Manuele Pesenti

Thank you Tim,

I tried but restarting apache and accessing the instance the browser 
takes a long time to respond and I get this error in log:


ImportError: No module named site

This is how my apache configuration looks like if could be of any help 
to understand the problem:




  ServerAdmin d...@colouree.com
  ServerName lab.mycompany.com

  SSLEngine on

  WSGIDaemonProcess laboratory python-home=/path/to/pyenv36 user=myuser 
group=myuser processes=1 threads=1

  WSGIProcessGroup laboratory
  WSGIScriptAlias / /path/to/web2py/wsgihandler.py
  WSGIPassAuthorization On

  
    AllowOverride None
    Require all denied
    
  Require all granted
    
  

  AliasMatch ^/([^/]+)/static/(?:_[\d]+.[\d]+.[\d]+/)?(.*) 
/path/to/web2py/applications/$1/static/$2


  
    Options -Indexes
    ExpiresActive On
    ExpiresDefault "access plus 1 hour"
    Require all granted
  

  CustomLog /var/log/apache2/ssl-lab-access.log common
  ErrorLog /var/log/apache2/lab-error.log
  ServerAlias laboratory.mycompany.com
  Include /etc/letsencrypt/options-ssl-apache.conf
  SSLCertificateFile /etc/letsencrypt/live/lab.mycompany.com/fullchain.pem
  SSLCertificateKeyFile /etc/letsencrypt/live/lab.mycompany.com/privkey.pem


On 21/01/20 12:58, Tim Nyborg wrote:

Yes, that should work.


--
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/12751f8d-1e74-da4f-5479-4d51ab9fde6f%40gmail.com.


Re: [web2py] py4web - using session object in a template

2020-01-21 Thread Jim Steil
Thanks Massimo.  I was hoping to avoid having to pass something to the view
every time.  I'm lazy, right?  I'm assuming that this is the same if I used
response instead of session.  In web2py you didn't have to pass response to
the view, it was automatically available.

-Jim

On Tue, Jan 21, 2020 at 1:00 AM Massimo Di Pierro <
massimo.dipie...@gmail.com> wrote:

> I would recommend you do something like this
>
> @action('index')
> @action.uses('index.html', session)
> def index():
> ...
> return dict(session=dict(session))
>
> This will pass a shallow copy of the session to the view. You will be free
> to read from the session in index.html but you should not write it.
>
>
>
> On Friday, 17 January 2020 12:34:43 UTC-8, Jim S wrote:
>>
>> I should re-state my problem.  With web2py I wasn't using session, but
>> response.  I added a couple of attributes that always got added to the
>> response object.  Not sure how to mimic that in py4web, or would I even
>> want to?
>>
>> -Jim
>>
>> On Fri, Jan 17, 2020 at 11:16 AM Jim S  wrote:
>>
>>> Hi
>>>
>>> I'm trying to pass a session variable to layout.html but it tells me
>>> that session is not available:
>>>
>>> NameError: name 'session' is not defined
>>>
>>> I use this technique in web2py to send a page title to layout.html
>>> without having to pass it in the returned dict from the controller.
>>>
>>> Obviously I'm being lazy using this technique.  Will this work with
>>> py4web or is it best for me to pass in explicitly in each controller?
>>>
>>> -Jim
>>>
>>> --
>>> 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 a topic in the
>>> Google Groups "web2py-users" group.
>>> To unsubscribe from this topic, visit
>>> https://groups.google.com/d/topic/web2py/cgg6M7B_wkI/unsubscribe.
>>> To unsubscribe from this group and all its topics, send an email to
>>> web2py+unsubscr...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/web2py/8848279b-e889-4b9b-90a6-664813a47b89%40googlegroups.com
>>> 
>>> .
>>>
>> --
> 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 a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/web2py/cgg6M7B_wkI/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> web2py+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/web2py/06f7bcfe-4a9f-42a0-a5ec-a686edf6513e%40googlegroups.com
> 
> .
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/CAERBpoBR4dAaBXrTPqPVM5936OTSs%3DUpKTr03DJF7W2KuJWdSQ%40mail.gmail.com.


Re: [web2py] Re: py4web - javascript references in html files

2020-01-21 Thread Jim Steil
I tried using URL() but then the login page didn't work.  I think there was
an error starting Vue.

-Jim

On Tue, Jan 21, 2020 at 1:04 AM Massimo Di Pierro <
massimo.dipie...@gmail.com> wrote:

> Good question. Not sure there is a way that is best.
> You are free to use URL everywhere but often it is not-necessary,
> specifically because all static files have the same prefix. It is therefore
> faster and more concise to use the above syntax.
>
>
> On Sunday, 19 January 2020 09:35:27 UTC-8, Jim S wrote:
>>
>> I'm wondering why in py4web you're not using the URL function to specify
>> the location of .js files.  This can be seen in layout.html and auth.html.
>> I also see that at the top of layout.html that you define:
>>
>> 
>>
>> I recall this being the best way to define them in web2py.
>>
>> Comments?
>>
>> -Jim
>>
> --
> 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 a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/web2py/RDHVdivJsZg/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> web2py+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/web2py/1eb242f5-3406-40f3-a41a-2cde6dc4b5f6%40googlegroups.com
> 
> .
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/CAERBpoBLz2mpJrz7PL%2B%3D5rSYkxM9qg8Aa2EhCuFjG1OM3D6fow%40mail.gmail.com.


[web2py] Re: Displaying for loop results only once

2020-01-21 Thread Tim Nyborg
Simplest fix: use "any" instead:

{{for bookings in bookings:}}

  {{if any(bookings.company in q.customer.company for q in quotes):}}
Quoted
  {{pass}}

{{pass}}


To avoid all this looping, you could have a separate query join the two 
tables and count the matches.

On Saturday, 18 January 2020 23:00:04 UTC, mostwanted wrote:
>
> In my quotation system I have come up with a way to remind users of 
> UN-deleted quotations. This helps them from creating new quotations on top 
> of old quotations.
> How it works is that when a company has been quoted its name is added to a 
> list called the control list and a selected company's name is checked 
> against this control list, if it is in the control list it will mean that 
> it has been quoted and a blue badge titled quoted will be displayed next to 
> the company's name. The problem I am facing now is that if the company has 
> several items quoted under it it means that its name will appear several  
> times in the control list, this causes the green badge to appear as many 
> times as the company name appears in the control list, I want avoid this, 
> is there a way to get the badge to appear only once regardless of the 
> number of times the company name appears in the control list?
>
> *CONTROLLER*
> def registeredClients():
> bookings=db(db.Client_Details).select(db.Client_Details.ALL, orderby=
> db.Client_Details.company)
> quotes=db(db.quotation).select()
> return locals()
>
> *CSS*
> .disc
> {
> border: solid 2px transparent;
> border-radius: 50%;
> width: 40px;
> padding: 5px;
> }
>
> .blue
> {
> background-color: blue;
> color: white;
> font-weight: bold;
> font-size: x-small;
> }
>
> *VIEW*
> {{for bookings in bookings:}}
>
> {{for q in quotes:}}
> {{quoted=[q.customer.company]}}
>  >Quoted
> {{pass}}
>
> {{pass}}
>
> Please help!!!
>
> Regards;
>
> Mostwanted
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/0bf81607-b9d6-4255-b5b5-bab17b29cc1c%40googlegroups.com.


[web2py] Re: running two web2py instances on the same server under apache wsgi mod

2020-01-21 Thread Tim Nyborg
Yes, that should work.

I have three web2py instances on a server running nginx/uwsgi, and the 
principle's the same: slightly different configs for each instance, 
pointing to separate source files.

On Tuesday, 21 January 2020 11:37:55 UTC, Manuele wrote:
>
> Hi! 
>
> If I need to manage on the same server two different web2py instances 
> (for example for having two distinct versions of web2py running) what 
> are the differences I have to consider with what reported in 
> documentation[1]? 
>
> At the moment I already have the first instance running through wsgi mod 
> using this configuration 
>
>  
>
>ServerAdmin d...@colouree.com  
>ServerName apps.mycompany.com 
>
>RewriteEngine On 
>RewriteCond %{HTTPS} !=on 
>RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L] 
>
>CustomLog /var/log/apache2/access-apps.log common 
>ErrorLog /var/log/apache2/apps.error.log 
>  
>
>  
>
>ServerAdmin d...@colouree.com  
>ServerName apps.mycompany.com 
>
>SSLEngine on 
>
>WSGIDaemonProcess web2py python-home=/path/to/pyenv27 user=myuser 
> group=mygroup processes=1 threads=1 
>WSGIProcessGroup web2py 
>WSGIScriptAlias / /path/to/web2py/wsgihandler.py 
>WSGIPassAuthorization On 
>
> 
>  AllowOverride None 
>  Require all denied 
>   
>Require all granted 
>   
> 
>
>AliasMatch ^/([^/]+)/static/(?:_[\d]+.[\d]+.[\d]+/)?(.*) 
> /path/to/web2py/applications/$1/static/$2 
>
> 
>  Options -Indexes 
>  ExpiresActive On 
>  ExpiresDefault "access plus 1 hour" 
>  Require all granted 
> 
>
>Include /etc/letsencrypt/options-ssl-apache.conf 
>
>CustomLog /var/log/apache2/ssl-apps-access.log common 
>ErrorLog /var/log/apache2/apps-error.log 
>ServerAlias applications.colouree.com 
>SSLCertificateFile /etc/letsencrypt/live/
> apps.mycompany.com/fullchain.pem 
>SSLCertificateKeyFile 
> /etc/letsencrypt/live/apps.mycompany.com/privkey.pem 
>  
>
> can I simply duplicate it changing essentials informations such 
> WSGIDaemonProcess definition (I'd like to specify even the path to a 
> different virtualenv based on python 3 in the second case) and other 
> stuff? 
>
> Thank you very much 
>
> Best regards 
>
>  Manuele 
>
> [1] http://web2py.com/books/default/chapter/29/13/deployment-recipes 
>
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/7619ac9c-549f-49fb-87b8-3cb6d10a3747%40googlegroups.com.


[web2py] running two web2py instances on the same server under apache wsgi mod

2020-01-21 Thread Manuele Pesenti

Hi!

If I need to manage on the same server two different web2py instances 
(for example for having two distinct versions of web2py running) what 
are the differences I have to consider with what reported in 
documentation[1]?


At the moment I already have the first instance running through wsgi mod 
using this configuration




  ServerAdmin d...@colouree.com
  ServerName apps.mycompany.com

  RewriteEngine On
  RewriteCond %{HTTPS} !=on
  RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]

  CustomLog /var/log/apache2/access-apps.log common
  ErrorLog /var/log/apache2/apps.error.log




  ServerAdmin d...@colouree.com
  ServerName apps.mycompany.com

  SSLEngine on

  WSGIDaemonProcess web2py python-home=/path/to/pyenv27 user=myuser 
group=mygroup processes=1 threads=1

  WSGIProcessGroup web2py
  WSGIScriptAlias / /path/to/web2py/wsgihandler.py
  WSGIPassAuthorization On

  
    AllowOverride None
    Require all denied
    
  Require all granted
    
  

  AliasMatch ^/([^/]+)/static/(?:_[\d]+.[\d]+.[\d]+/)?(.*) 
/path/to/web2py/applications/$1/static/$2


  
    Options -Indexes
    ExpiresActive On
    ExpiresDefault "access plus 1 hour"
    Require all granted
  

  Include /etc/letsencrypt/options-ssl-apache.conf

  CustomLog /var/log/apache2/ssl-apps-access.log common
  ErrorLog /var/log/apache2/apps-error.log
  ServerAlias applications.colouree.com
  SSLCertificateFile /etc/letsencrypt/live/apps.mycompany.com/fullchain.pem
  SSLCertificateKeyFile 
/etc/letsencrypt/live/apps.mycompany.com/privkey.pem



can I simply duplicate it changing essentials informations such 
WSGIDaemonProcess definition (I'd like to specify even the path to a 
different virtualenv based on python 3 in the second case) and other stuff?


Thank you very much

Best regards

    Manuele

[1] http://web2py.com/books/default/chapter/29/13/deployment-recipes

--
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/8c44c54f-4770-21a0-9104-52fe4bc69660%40gmail.com.


Re: [web2py] Re: web2py and reverse proxy. How to expose a single application behind a hostname

2020-01-21 Thread Manuele Pesenti

Yes! It seams the right way... thank you Dave

    M.

On 21/01/20 09:45, Dave S wrote:

Check out routes.py, as described at
http://www.web2py.com/books/default/chapter/29/04/the-core#URL-rewrite>


--
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/e4d55f96-84ba-3298-fb8a-8aa1824be769%40gmail.com.


[web2py] Re: Py4web: ¿Practical example step by step?

2020-01-21 Thread Dave S


On Monday, January 20, 2020 at 4:55:33 AM UTC-8, Yuver Parra wrote:
>
>
> Good morning and thanks in advance for sharing your knowledge in this 
> group.
> Do any of you have a practical example where you can follow step by step 
> learning from the installation of py4web to the setting up of a site?
>
> Thanks for the reply.
>

When posting a new euqestion, please don't check "show at the top" --- save 
that for messages that need to be displayed long-term,
like etiquette or policy.

Have you looked at README.md at
https://github.com/web2py/py4web> ?

This should make a small stand-alone server and one or more sample 
applications.

If you have looked at that introduction, what questions do you still have?

Also, look at the py4web documentation at


I haven't heard of any training videos yet (the older framework, web2py, 
has several, but those wouldn't be useful for py4web).

If you need to learn more about setting up a front-end server, such as 
NginX, you should consult the NginX website.  
(the web2py position on Apache is that if you don't have it already, you 
should consider NginX or other easier-to-use front ends.)

Good luck!

/dps


-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/639ee04f-b321-4784-a93a-f8d0e6f19bca%40googlegroups.com.


[web2py] Re: Web2py - How would I monitor an existing running script?

2020-01-21 Thread Dave S


On Monday, January 20, 2020 at 10:55:28 PM UTC-8, Simon Dreyer wrote:
>
> Hi Folks, I have an existing python application that reads data from 
> industrial controllers and publishes it to a message queue. The application 
> is currently headless and logs errors and events to a log file. I would 
> like to add a web interface to the application so that I can log into the 
> app at any time and check the status while it is running. All the web2py 
> examples that I have seen seem to load/run a python script when the user 
> invokes a view, how would I invoke a connection to a script that is already 
> running please?
>

The first idea I have is just to return the latest entries from the log 
file.  

If your control application is polling the controllers, you can set up 
something else for it to poll, and put something there with the web app, 
and issue a response to it.

If you control application is being pinged by the controllers, perhaps you 
can use a socket to ping it from the web app.

Much beyond that handwaving response would require knowing more about the 
existing architecture.

/dps

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/ef610cf9-326d-4376-afa8-2588b52eadfc%40googlegroups.com.


Re: [web2py] No driver of supported ones ('psycopg2',) is available

2020-01-21 Thread Dave S


On Monday, January 20, 2020 at 10:15:29 AM UTC-8, Lovedie JC wrote:
>
> I had to copy it, the folder to Web2py modules folder for it to work. You 
> can also copy to Web2py site packages folder.
> Regards 
>
> On Mon, Jan 20, 2020, 20:53 'Annet' via web2py-users <
> web...@googlegroups.com > wrote:
>
>> Last week I upgraded my development environment from Mac OS X Mavericks - 
>> Python 2.7 - Web2py 2.14.5 to
>> Mac OS X Catalina - Python 2.7 - Web2py 2.18.5, since then I have the 
>> following issue:
>> [...] 
>>
> I have psycopg2 installed in the python directory 
>> /Library/Python/2.7/site-packages/ that is not where web2py expects it to 
>> be, is there a way to solve this issue?
>>
>>

For what it's worth, that is where web2py expects it on my AWS system; my 
issue was using the proper version of pip to install it.  Full descriptions 
of my fun in the archives.  (I'm still on 2.15.4, while I keep saying 
"2.18.x any day now")

/dps

 

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/2acddfda-d0c7-4ead-8d38-c3432f0345d4%40googlegroups.com.


[web2py] Re: web2py and reverse proxy. How to expose a single application behind a hostname

2020-01-21 Thread Dave S


On Monday, January 20, 2020 at 8:49:13 AM UTC-8, Manuele wrote:
>
> Hi! 
>
> For our deploy installation I followed successfully the procedures in 
> documentation so now I have my server exposing the web2py root, now I 
> tried to configure a second host name using an apache reverse proxy 
> configuration to serve directly a specific application, is it possible? 
>
> Let's say my application is reachable under apps.mycompany.com/myapp and 
> now I want to setup the virtualhost myapp.mycompany.com as a reverse 
> proxy to direcly serve the app. I've used this apache proxy configuration: 
>
>  
>ServerName myapp.mycompany.com 
> [...] 

 
>
> The problem is that every link included in the page contains even the 
> application name such as: 
>
> https://analytics.colouree.com/welcome/static/css/bootstrap.min.css and 
> so on. 
>
> Is there a possible way to fix it with some framework configuration? 
>
>
Check out routes.py, as described at 
http://www.web2py.com/books/default/chapter/29/04/the-core#URL-rewrite>

/dps

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/113292d7-6f51-4d73-9426-92e4b98f7159%40googlegroups.com.