[web2py] Re: Overiding the auth table ID fields to allow for release over pillars (Development, Acceptance, Production)

2019-09-12 Thread Davidiam
We have looked in this further, and due to the autoincremented ID fields in 
the Auth tables, we are going to have a very complicated release process.

The problem is that the ID will be used in all references to the users and 
groups but between pillars (DEV,ACC,PRO) the ID's may not be the same which 
will cause a data mismatch.  

As these fields are autoincremented integer fields, we can not use our 
alphanumeric keys from our internal systems.  
We have found a solution but it will make our releases much more 
complicated unfortunately.

Regards,
David

On Tuesday, September 10, 2019 at 8:16:00 PM UTC+2, Val K wrote:
>
> why do you have to override ids? You can just create users with the 
> required ids.

-- 
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/feec1275-64cc-47d5-8fdf-765262268c5d%40googlegroups.com.


[web2py] Overiding the auth table ID fields to allow for release over pillars (Development, Acceptance, Production)

2019-09-10 Thread Davidiam
We are planning on using Web2Py in a 3 tier release model (Development, 
Acceptance, Production) but as the ID fields in the auth tables are used as 
primary and foreign keys, we are concerned that this will cause 
inconsistencies between the different pillars.
We will be using SSO for access to web2py and users and groups need to be 
defined via our company's identity management system.  We plan on running 
scripts to update the Auth users and group tables based on a daily file 
feed.

We may need to create groups and group memberships manually in the 
development pillar which will later be defined in our identity management 
and AD systems to have them also in acceptance and production and so the 
IDs may become a mess.

One idea we had is to override the generated IDs in the USER and GROUP 
tables with the ID from our single source identity feed using its unique 
keys (user_id and group_id from our internal systems), but we are not sure 
if this will create problems down the line with the other tables which use 
the automatically generated sequential ID's, for example, the 
auth_permission table.

Any recommendations on how to deal with this issue in Web2Py releases ?  
Would our idea of replacing the ids with the unique id's provided by our 
internal systems be a solution or cause other issues ?

Kind Regards,
David

-- 
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/00691d6d-7d15-47e0-a27e-d19b601bee96%40googlegroups.com.


[web2py] Re: Overiding the auth table ID fields to allow for release over pillars (Development, Acceptance, Production)

2019-09-11 Thread Davidiam
Thanks for your reply.

Maybe override was not the best term.  We can create the users using the 
userid and groupid as the ids in the user, group and membership tables, but 
as Web2Py out of the box creates an id (sequentially incremented) we are 
concerned that specifying a different id might have repercussions down the 
line.
Also because the automatically generated ids in the other auth tables may 
be different between pillars.

I have been looking into this further and I don't think we will have a 
problem if we create the user and group tables using our own unique id's in 
the id fields.  

On Tuesday, September 10, 2019 at 8:16:00 PM UTC+2, Val K wrote:
>
> why do you have to override ids? You can just create users with the 
> required ids.

-- 
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/fa52405e-f587-4948-b712-42e4b8f599b4%40googlegroups.com.


[web2py] Re: Web2Py and ldap integration

2019-08-01 Thread Davidiam
Thank you very much for the info.  In the mean time we have decided to use 
shibboleth because we had a lot of issues with the python modules on Windows 
and because the project added the requirement for sso. I will keep your 
solution as a reference for the future. 

-- 
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/3fc54c21-a081-4f72-a8d7-e2a1f354e7ee%40googlegroups.com.


Re: [web2py] Web2Py with LDAP and SAML : Is it worth it for Windows ?

2019-08-01 Thread Davidiam
We are working on a Shibboleth implementation now. So far it is working better 
than the other tests we did on Windows.

We wanted to test it using a localhost Shibboleth sp and idp but it wasn't 
clear to us how we needed to configure it.

Thanks for the tip! 

-- 
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/214e0d91-b159-4768-99c3-46ee708897b3%40googlegroups.com.


[web2py] Web2Py and ldap integration

2019-07-19 Thread Davidiam
Hello,

I have read and implemented the recipe for Windows active directory ldap 
integration with Web2Py (
http://www.web2py.com/books/default/chapter/29/09/access-control) and for 
the most part the documentation is clear except for the last bit where it 
refers to : 

from gluon.contrib.login_methods.ldap_auth import ldap_auth
auth.settings.login_methods.append(ldap_auth(mode='ad',
   server='my.domain.controller',
   base_dn='ou=Users,dc=domain,dc=com'))

For me there are 2 things that aren't clear here :
1) Where should this code be inserted ?  In the default.py controller or in 
db.py or somewhere else ?
2) We have multiple domain controllers in our domain, do we need to supply 
a specific server for the server parameter ?

An example of implementing this with the welcome application would be 
appreciated, specifying the file which was modified. 

-- 
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/3f5413ca-f2d1-4576-877c-3a2cd0f745b1%40googlegroups.com.


[web2py] Web2Py on IIS, multiple apps under virtual directories

2019-07-19 Thread Davidiam
Hello,

I have setup Web2Py with IIS using fastcgi and I got the application 
running (currently testing using the Welcome app).

In our project we will have multiple applications running parallel to each 
other, each under a separate application.
To do this, we have created the following structure : 
D:\web2py\
D:\web2py\QF1
D:\web2py\QF2
D:\web2py\QF3

Under these directories we copied the web2py files (so the web.config, 
routes.py are in the QFx directories).
We converted the virtual directories to apps and set the user rights 
according to the documentation.

In each of the routes.py, we set the path_prefix according to the name of 
the virtual directory :
for example, for QF1 we put :
routers = dict(BASE=dict(path_prefix = "qf1"))

When we run the welcome app for qf1, it works, but then when we try to run 
qf2 it immediately redirects to qf1, and the same for qf3.
The app to which it redirects can vary depending on the first one we run 
(after a while it seems to reset itself).
We do not see what is causing the redirect, I have tried modifying the 
web.config but so far no success in fixing the issue.
Is there any way to log this ?

Fastcgi is configured at server level.  We are using one application pool.  
We tried enabling logging but without success.
Any help would be appreciated.

-- 
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/acc994ce-6b1d-4764-bf92-ba0a8e4e2fc6%40googlegroups.com.


[web2py] Web2Py with LDAP and SAML : Is it worth it for Windows ?

2019-07-24 Thread Davidiam
We have been trying to implement a web2py project on a Windows IIS server 
for the last few weeks and we are currently considering abandoning the 
project due to the absence of LDAP and SAML modules for Windows.

We are running python 3.7 with IIS 8.  We managed to get that configuration 
running pretty easily.  We then tried to integrate ldap.
python-ldap seems to depend on Openldap and from what we can see, doesn't 
work on Windows for Python 3.7.
Pyldap3 seems to work better, but would need to be integrated into the auth 
framework of Web2Py but the project decided to prefer SAML so the pyldap3 
option was put on hold.

We started trying to implement SAML  Python-saml also seems to have been 
made for Linux but doesn't seem to work in Windows with Python 3.7.

We then tried Pysaml2, which installed without a problem, but we saw that 
we also needed xmlsec and then we started running into other errors and 
still have not managed to install ithe other modules needed like xmlsec 
(maybe due to our secure environment and firewall settings).

Question : Is it even possible to use SAML with Python 3.7 on Windows ??  
We have lost already weeks on this and we don't want to lose more time if 
in the end it isn't possible.
Has anyone done this ?  How did you do it ?  If it is a lost cause I prefer 
knowing that now.

It basically looks like most modules needed were built for Linux and not 
for Windows.and for python 2.7 and not for python 3.X.

You help or input will be greatly appreciated !!  Would especially 
appreciate any feedback from Massimo if he reads this.

-- 
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/ff2b4602-66ba-4949-b6ca-f405598c9d0d%40googlegroups.com.


[web2py] Re: Web2Py on IIS, multiple apps under virtual directories

2019-07-22 Thread Davidiam
Solved.  I needed to add a separate fastcgi per system by modifying the 
web.confi fastcgi line and adding the and in IIS I needed to add a separate 
fastcgi application for each installation.

On Saturday, July 20, 2019 at 7:30:00 AM UTC+2, Davidiam wrote:
>
> Hello,
>
> I have setup Web2Py with IIS using fastcgi and I got the application 
> running (currently testing using the Welcome app).
>
> In our project we will have multiple applications running parallel to each 
> other, each under a separate application.
> To do this, we have created the following structure : 
> D:\web2py\
> D:\web2py\QF1
> D:\web2py\QF2
> D:\web2py\QF3
>
> Under these directories we copied the web2py files (so the web.config, 
> routes.py are in the QFx directories).
> We converted the virtual directories to apps and set the user rights 
> according to the documentation.
>
> In each of the routes.py, we set the path_prefix according to the name of 
> the virtual directory :
> for example, for QF1 we put :
> routers = dict(BASE=dict(path_prefix = "qf1"))
>
> When we run the welcome app for qf1, it works, but then when we try to run 
> qf2 it immediately redirects to qf1, and the same for qf3.
> The app to which it redirects can vary depending on the first one we run 
> (after a while it seems to reset itself).
> We do not see what is causing the redirect, I have tried modifying the 
> web.config but so far no success in fixing the issue.
> Is there any way to log this ?
>
> Fastcgi is configured at server level.  We are using one application 
> pool.  We tried enabling logging but without success.
> Any help would be appreciated.
>

-- 
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/547020ad-257d-45c7-b399-fa04b476ad9d%40googlegroups.com.


[web2py] Re: Communication error when saving in admin web interface

2019-11-07 Thread Davidiam
Thanks for your reply.  I have also had this when testing locally but only 
when debugging the save process.  I noticed that the save failed when I 
stepped through the code, most likely due to a timeout.
In our case, it seems to be worse the longer the edit session stays open as 
I mentioned in my first post.  

Kind Regards,
David

As a work-around we are now using a local editor mapped to the server drive 
and that seems to not have these issues.
I would still like to see this solved (longer timeout?) but we have a 
work-around for the moment.

Regards,
David

On Thursday, November 7, 2019 at 9:30:41 AM UTC+1, Dave S wrote:
>
>
>
> On Wednesday, November 6, 2019 at 10:55:34 PM UTC-8, Davidiam wrote:
>>
>> Windows server 2016, IIS 10, Windows 10, Edge
>>
>> Version
>>
>> 2.18.5-stable+timestamp.2019.04.08.04.22.03
>> (Running on Microsoft-IIS/10.0, Python 3.6.8) 
>> Hello,
>>
>> A few of our developers have been experiencing this so I thought I would 
>> ask the forum for help.
>>  
>> If we edit a file in the web2py admin console, we often get a red 
>> communication error in the "Last saved on" field.
>>
>> I did some testing and I noticed that this happens pretty consistently if 
>> I save after about 90 seconds. It is almost as though the editing session 
>> times out.  
>> After a refresh of the page in the Edge web browser I can again do saves.
>>
>> If I save every 10 or 20 seconds, the saves are successful. 
>>
>> Has anyone else noticed this issue?  Or even better, is there a solution 
>> to this problem?
>>
>> I do not find any logging for this error.
>>
>> Kind Regards,
>> David
>>
>
>
>
> I get this kind of error occasionally.   Where it may be weeks between 
> errors.  But I'm running Windows desktop, not server, using Rocket instead 
> of IIS, and Chrome for the browser.  The webserver involved is only 
> accessed from the local machine.
>
> In my case, it seems the request times out (not the session), and that can 
> happen when Chrome is doing a lot of browser cache related accesses to 
> Rocket (as best as I can tell; the activity meter on the web2py "console 
> GUI" is almost continuously spiking even though I stop clicking on things; 
> it can persist indefinitely).  My treatment of these symptoms is to close 
> the browser window, wait for things to quiet down, and reopen the window.  
> (It may be possible to just close tabs, but I often have a dozen tabs 
> pointing at my applications or the admin pages.  Using the browser menu to 
> select "clear cache" doesn't seem to help.)
>
> I have also seen the error when there is a path or permission issue, IIRC, 
> but that is unlikely to explain your symptoms.
>
> Try a different browser to see if you get the same errors.  Monitor the 
> browser's background accesses to see if they spike during the session.
>
> 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/6072ea00-a0e3-453b-bf3b-0efd1a1ed704%40googlegroups.com.


[web2py] Communication error when saving in admin web interface

2019-11-06 Thread Davidiam
Windows server 2016, IIS 10, Windows 10, Edge

Version

2.18.5-stable+timestamp.2019.04.08.04.22.03
(Running on Microsoft-IIS/10.0, Python 3.6.8) 
Hello,

A few of our developers have been experiencing this so I thought I would 
ask the forum for help.
 
If we edit a file in the web2py admin console, we often get a red 
communication error in the "Last saved on" field.

I did some testing and I noticed that this happens pretty consistently if I 
save after about 90 seconds. It is almost as though the editing session 
times out.  
After a refresh of the page in the Edge web browser I can again do saves.

If I save every 10 or 20 seconds, the saves are successful. 

Has anyone else noticed this issue?  Or even better, is there a solution to 
this problem?

I do not find any logging for this error.

Kind Regards,
David

-- 
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/d6e83d7f-70f0-44cc-bc80-787c8fd809a9%40googlegroups.com.


[web2py] Re: Setting a pre-authenticated user (no password in auth db) as "logged in" for web2py app

2019-10-18 Thread Davidiam
Thank you for your reply.  It looks to me that that method should do the 
trick.  
I will try it out today and give an update afterward.

Kind Regards,
David

On Thursday, October 17, 2019 at 4:59:54 PM UTC+2, Ruslan Gareev wrote:
>
> Hi, i think that a "login_user" method in AuthApi meets your reqests.
>
> четверг, 17 октября 2019 г., 13:33:43 UTC+5 пользователь Davidiam написал:
>>
>> Hello,
>>
>> We pre-authenticate users outside of web2py via SAML and the user lands 
>> on a page where he can choose from a list of applications.
>> When the user selects an application, he needs to be set as "logged in" 
>> for that web2py application as long as there his userid exists in the auth 
>> table (no password)..
>>
>> I do not see any login method that allows us to just say : "set this user 
>> as logged in".
>>
>> The closest I see is the "login_bare" function, but that expects a 
>> password and these users do not have a password entry in the auth table.
>>
>> Any ideas on the best way to handle this scenario ?  
>>
>> Note : I would really like to avoid using the SAML login modules as these 
>> are an uphill battle on Windows IIS and we already have a working 
>> authentication for the users via Shibboleth SP.
>>
>> Kind Regards,
>> David
>>
>

-- 
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/143b0ca0-72c4-4d76-84b1-772dc26fc5da%40googlegroups.com.


[web2py] Re: Setting a pre-authenticated user (no password in auth db) as "logged in" for web2py app

2019-10-18 Thread Davidiam
Hello Ruslan,

I tried to use the "authapi.login_user" method but it looks to me like the 
login_bare method works better and requires less coding to make it work.
I currently have added the login code to the "user" method in the 
"default.py".  

When I used the "authapi.login_user" method, it logs my user in, but still 
displays the login window instead of skipping it as I would like.
When I use the "login_bare" method, it does not display the login window.

Thanks you for you time, 
On Thursday, October 17, 2019 at 4:59:54 PM UTC+2, Ruslan Gareev wrote:
>
> Hi, i think that a "login_user" method in AuthApi meets your reqests.
>
> четверг, 17 октября 2019 г., 13:33:43 UTC+5 пользователь Davidiam написал:
>>
>> Hello,
>>
>> We pre-authenticate users outside of web2py via SAML and the user lands 
>> on a page where he can choose from a list of applications.
>> When the user selects an application, he needs to be set as "logged in" 
>> for that web2py application as long as there his userid exists in the auth 
>> table (no password)..
>>
>> I do not see any login method that allows us to just say : "set this user 
>> as logged in".
>>
>> The closest I see is the "login_bare" function, but that expects a 
>> password and these users do not have a password entry in the auth table.
>>
>> Any ideas on the best way to handle this scenario ?  
>>
>> Note : I would really like to avoid using the SAML login modules as these 
>> are an uphill battle on Windows IIS and we already have a working 
>> authentication for the users via Shibboleth SP.
>>
>> Kind Regards,
>> David
>>
>

-- 
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/80e2e167-47aa-4a0c-94f3-c2ab2c5cbdca%40googlegroups.com.


[web2py] Re: Setting a pre-authenticated user (no password in auth db) as "logged in" for web2py app

2019-10-22 Thread Davidiam
Hello Ruslan,

I used this syntax in the user method of the default.py controller for my 
app :
user = authapi.login_user(user)  # in your original reply you 
recommended the Authapi method, so I used that one.

This worked, and my user was logged in, but the user login form which was 
still displayed afterward.  

If I used the login_bare method it does not display the login form.

Kind Regards,
David

On Tuesday, October 22, 2019 at 9:59:19 AM UTC+2, Ruslan Gareev wrote:
>
> Hi. How did you used login_user method? Is it was like this: 
> auth.login_user(user)
> ?
>
>
> пятница, 18 октября 2019 г., 18:34:31 UTC+5 пользователь Davidiam написал:
>>
>> Hello Ruslan,
>>
>> I tried to use the "authapi.login_user" method but it looks to me like 
>> the login_bare method works better and requires less coding to make it work.
>> I currently have added the login code to the "user" method in the 
>> "default.py".  
>>
>> When I used the "authapi.login_user" method, it logs my user in, but 
>> still displays the login window instead of skipping it as I would like.
>> When I use the "login_bare" method, it does not display the login window.
>>
>> Thanks you for you time, 
>> On Thursday, October 17, 2019 at 4:59:54 PM UTC+2, Ruslan Gareev wrote:
>>>
>>> Hi, i think that a "login_user" method in AuthApi meets your reqests.
>>>
>>> четверг, 17 октября 2019 г., 13:33:43 UTC+5 пользователь Davidiam 
>>> написал:
>>>>
>>>> Hello,
>>>>
>>>> We pre-authenticate users outside of web2py via SAML and the user lands 
>>>> on a page where he can choose from a list of applications.
>>>> When the user selects an application, he needs to be set as "logged in" 
>>>> for that web2py application as long as there his userid exists in the auth 
>>>> table (no password)..
>>>>
>>>> I do not see any login method that allows us to just say : "set this 
>>>> user as logged in".
>>>>
>>>> The closest I see is the "login_bare" function, but that expects a 
>>>> password and these users do not have a password entry in the auth table.
>>>>
>>>> Any ideas on the best way to handle this scenario ?  
>>>>
>>>> Note : I would really like to avoid using the SAML login modules as 
>>>> these are an uphill battle on Windows IIS and we already have a working 
>>>> authentication for the users via Shibboleth SP.
>>>>
>>>> Kind Regards,
>>>> David
>>>>
>>>

-- 
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/704ade83-9e0e-45ea-a4a8-0ebb5c938f4f%40googlegroups.com.


[web2py] Re: Setting a pre-authenticated user (no password in auth db) as "logged in" for web2py app

2019-10-22 Thread Davidiam
Thanks!  I will try this and get back to you ;-)

On Tuesday, October 22, 2019 at 11:56:17 AM UTC+2, Ruslan Gareev wrote:
>
> Sorry for some unspelling ) It must be auth.login_user().
> Auth class extends AuthApi class. So you do not need use 
> authapi.login_user. And there is a `settings.renew_session_onlogin` in 
> login_user, and i think that it is equal to False, and your session is not 
> renewed, when you using authapi.login_user. In Auth class this variable 
> equals to True.
>
> вторник, 22 октября 2019 г., 14:17:47 UTC+5 пользователь Davidiam написал:
>>
>> Hello Ruslan,
>>
>> I used this syntax in the user method of the default.py controller for my 
>> app :
>> user = authapi.login_user(user)  # in your original reply you 
>> recommended the Authapi method, so I used that one.
>>
>> This worked, and my user was logged in, but the user login form which was 
>> still displayed afterward.  
>>
>> If I used the login_bare method it does not display the login form.
>>
>> Kind Regards,
>> David
>>
>> On Tuesday, October 22, 2019 at 9:59:19 AM UTC+2, Ruslan Gareev wrote:
>>>
>>> Hi. How did you used login_user method? Is it was like this: 
>>> auth.login_user(user)
>>> ?
>>>
>>>
>>> пятница, 18 октября 2019 г., 18:34:31 UTC+5 пользователь Davidiam 
>>> написал:
>>>>
>>>> Hello Ruslan,
>>>>
>>>> I tried to use the "authapi.login_user" method but it looks to me like 
>>>> the login_bare method works better and requires less coding to make it 
>>>> work.
>>>> I currently have added the login code to the "user" method in the 
>>>> "default.py".  
>>>>
>>>> When I used the "authapi.login_user" method, it logs my user in, but 
>>>> still displays the login window instead of skipping it as I would like.
>>>> When I use the "login_bare" method, it does not display the login 
>>>> window.
>>>>
>>>> Thanks you for you time, 
>>>> On Thursday, October 17, 2019 at 4:59:54 PM UTC+2, Ruslan Gareev wrote:
>>>>>
>>>>> Hi, i think that a "login_user" method in AuthApi meets your reqests.
>>>>>
>>>>> четверг, 17 октября 2019 г., 13:33:43 UTC+5 пользователь Davidiam 
>>>>> написал:
>>>>>>
>>>>>> Hello,
>>>>>>
>>>>>> We pre-authenticate users outside of web2py via SAML and the user 
>>>>>> lands on a page where he can choose from a list of applications.
>>>>>> When the user selects an application, he needs to be set as "logged 
>>>>>> in" for that web2py application as long as there his userid exists in 
>>>>>> the 
>>>>>> auth table (no password)..
>>>>>>
>>>>>> I do not see any login method that allows us to just say : "set this 
>>>>>> user as logged in".
>>>>>>
>>>>>> The closest I see is the "login_bare" function, but that expects a 
>>>>>> password and these users do not have a password entry in the auth table.
>>>>>>
>>>>>> Any ideas on the best way to handle this scenario ?  
>>>>>>
>>>>>> Note : I would really like to avoid using the SAML login modules as 
>>>>>> these are an uphill battle on Windows IIS and we already have a working 
>>>>>> authentication for the users via Shibboleth SP.
>>>>>>
>>>>>> Kind Regards,
>>>>>> David
>>>>>>
>>>>>

-- 
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/327ee139-8c25-4741-94bb-3e704a22f974%40googlegroups.com.


[web2py] Uploading a file under the Static section of web2py admin gets exception

2019-10-22 Thread Davidiam
Hello,

I am trying to upload files via the Welcome appadmin in the Static files 
section, but the uploads are failing with "Cannot upload file "

I have now traced this in Pycharm and it is failing on the call to the 
count_lines method in the admin\controllers\default.py 

In the debugger I see the message "AttributeError: 'dict" object has no 
attribulte 'len'"

Admin\Controllers\default.py : 

Upload_file method calls count_lines method with the data from the file

 

data variable contains :

b"from pyspark.sql.functions import udf\r\nfrom pyspark.sql.types import 
IntegerType, StringType\r\n\r\n\r\n@udf(IntegerType())\r\ndef 
to_celsius(temp):\r\nif isinstance(temp, int):\r\n "

 

def count_lines(data):

return len([line for line in data.split('\n') if line.strip() and not 
line.startswith('#')])

 

*Error Message :*

AttributeError: 'dict" object has no attribulte 'len'


Note: I have tried this with multiple text and binary files.  


I am working in a Winows environmet and using python 3.6

Web2py : Version2.18.5-stable+timestamp.2019.04.08.04.22.03


Did we set something up incorrectly, or is this a bug in web2py ?


Thanks in advance,

David



-- 
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/f8a37f8d-dfa0-4537-8bb2-9a96296a30c7%40googlegroups.com.


[web2py] Re: Uploading a file under the Static section of web2py admin gets exception

2019-10-22 Thread Davidiam


On Tuesday, October 22, 2019 at 11:08:07 AM UTC+2, Davidiam wrote:
>
> Hello,
>
> I am trying to upload files via the Welcome appadmin in the Static files 
> section, but the uploads are failing with "Cannot upload file "
>
> I have now traced this in Pycharm and it is failing on the call to the 
> count_lines method in the admin\controllers\default.py 
>
> In the debugger I see the message "AttributeError: 'dict" object has no 
> attribulte 'len'"
>
> Admin\Controllers\default.py : 
>
> Upload_file method calls count_lines method with the data from the file
>
>  
>
> data variable contains :
>
> b"from pyspark.sql.functions import udf\r\nfrom pyspark.sql.types import 
> IntegerType, StringType\r\n\r\n\r\n@udf(IntegerType())\r\ndef 
> to_celsius(temp):\r\nif isinstance(temp, int):\r\n "
>
>  
>
> def count_lines(data):
>
> return len([line for line in data.split('\n') if line.strip() and not 
> line.startswith('#')])
>
>  
>
> *Error Message :*
>
> AttributeError: 'dict" object has no attribulte 'len'
>
>
> Note: I have tried this with multiple text and binary files.  
>
>
> I am working in a Winows environmet and using python 3.6
>
> Web2py : Version2.18.5-stable+timestamp.2019.04.08.04.22.03
>
>
> Did we set something up incorrectly, or is this a bug in web2py ?
>
>
> Thanks in advance,
>
> David
>
>
>
>

-- 
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/ec57ace0-d635-4f10-a060-cf28e6baadfc%40googlegroups.com.


Re: [web2py] Web2Py with LDAP and SAML : Is it worth it for Windows ?

2019-10-22 Thread Davidiam
Thank you.  In the meantime we have gotten Shibboleth working correctly and 
we have just added an auth login to the user method in the default 
controller for the app.
This way, users are automatically logged in as soon as any routine has they 
call a method requiring login or a group membership.

So far seems to be working well.  We are still ironing out some finer 
points of the implementation.

Kind Regards,
David

On Monday, August 19, 2019 at 3:58:37 PM UTC+2, Pbop wrote:
>
> I am not familiar enough with how AUTH works but can offer a perspective 
> that might help to the level you want AUTH to support AD or SAML2 SSOs. 
>
> In both AD and SAML using the Shibboleth IIS Plug-in, you are in essence 
> designating a protected folder on the IIS web-server to require 
> authentication. In other words, if you land to that protected folder and 
> are NOT authenticated, IIS presents to the user an IIS generated 
> Challenge/Response screen to enter credentials for AD or sends you to the 
> IDP server (which can be any SAML2 IDP such as Shibboleth, ADFS, Azzure, 
> Google, Okta... ) for authentication. In both cases once IIS determines you 
> are authenticated (not the web-app), you ultimately are redirected back to 
> the protected folder as an authenticated user. As an authenticated user, 
> your browser header now has your login id in the header for AD and whatever 
> identity attributes are released from the IDP server such as login id, 
> emaiil, employee number, full name, shoe size... The catch to SAML2 is the 
> identity attributes can be whatever you agree to in the initial 
> configuration. 
>
> My point is authentication is managed at the web-server and does not need 
> to be in the web application. What does need to be in the web application, 
> if AUTH is to be used, is some sort of mapping of the browser header 
> variables to appropriate columns and extending the data model if additional 
> identity attributes are needed once the user is authenticated. 
>
> Perhaps I am over simplifying! Hope this helps! 
>
>
> On Sunday, August 18, 2019 at 1:35:32 AM UTC-4, Massimo Di Pierro wrote:
>>
>> web2py or py4web? I could use some help getting it to work for py4web.
>>
>> On Thursday, 1 August 2019 07:08:10 UTC-7, Davidiam wrote:
>>>
>>> We are working on a Shibboleth implementation now. So far it is working 
>>> better than the other tests we did on Windows.
>>>
>>> We wanted to test it using a localhost Shibboleth sp and idp but it 
>>> wasn't clear to us how we needed to configure it.
>>>
>>> Thanks for the tip! 
>>>
>>>

-- 
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/0daf7711-43dc-43d8-bfc1-36d18856ecaf%40googlegroups.com.


[web2py] Re: wfastcgi , iis & python 3 not working?

2019-10-22 Thread Davidiam
We have more or less the same configuration with no issues.

One thing that might help you though 
You can setup the admin app to work over https:

https://www.youtube.com/watch?v=_4to_44DcJU  time :   46:15

Run from web2py base folder :

For 2.7 :

from gluon.main import save_password; save_password(raw_input('admin 
password: '),443)

For 3.x

from gluon.main import save_password; save_password(input('admin password: 
'),443)

but otherwise you should be able to run the admin via http from the server.

Good luck,
David


On Tuesday, October 22, 2019 at 8:25:34 AM UTC+2, martel berends wrote:
>
> I'm trying to deploy a web2py server with the following specs:
> - Windows server 2019
> - IIS 10
> - Python 3.5 above
>
> I followed the deployment scripts in de manual (
> http://web2py.com/books/default/chapter/29/13/deployment-recipes#IIS) and 
> the excellent video of Remco Boerma (https://youtu.be/gxOhsThD0FY) 
>
> I've the basic site working, but when I go to the admin section, an error 
> occurs :
>
> Error occurred:
>
> Traceback (most recent call last):
>   File "c:\python36-32\lib\site-packages\wfastcgi.py", line 851, in main
> response.send(FCGI_STDOUT, part)
>   File "c:\python36-32\lib\site-packages\wfastcgi.py", line 756, in send
> return send_response(self.stream, self.record.req_id, resp_type, content, 
> streaming)
>   File "c:\python36-32\lib\site-packages\wfastcgi.py", line 370, in 
> send_response
> raise TypeError("content must be encoded before sending: %r" % content)
> TypeError: content must be encoded before sending: 'a'
>
>
> I've tried python 3.4 / 3.5 / 3.6 and 3.7 but all with the same result. Going 
> back to 2.7 is not what I want, due to end-of-life of python 2.7 and my site 
> is coded in Python 3. 
>
> I've installed the source-code version of web2py and the user-registration in 
> the standard welcome application is working fine. So the patform seems to 
> work. 
>
>
> It's something between web2py and wfastcgi, but I've no clue what is causing 
> this error and how to solve it. 
>
>
> Any help would be fantastic. 
>
>

-- 
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/b7bcb8ee-80c4-4821-8ee8-3addf0bebab3%40googlegroups.com.


[web2py] Setting a pre-authenticated user (no password in auth db) as "logged in" for web2py app

2019-10-17 Thread Davidiam
Hello,

We pre-authenticate users outside of web2py via SAML and the user lands on 
a page where he can choose from a list of applications.
When the user selects an application, he needs to be set as "logged in" for 
that web2py application as long as there his userid exists in the auth 
table (no password)..

I do not see any login method that allows us to just say : "set this user 
as logged in".

The closest I see is the "login_bare" function, but that expects a password 
and these users do not have a password entry in the auth table.

Any ideas on the best way to handle this scenario ?  

Note : I would really like to avoid using the SAML login modules as these 
are an uphill battle on Windows IIS and we already have a working 
authentication for the users via Shibboleth SP.

Kind Regards,
David

-- 
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/55d7612d-e490-4cc0-946e-672e46488efb%40googlegroups.com.


[web2py] mssql set identity_insert on

2019-12-19 Thread Davidiam
As part of our release process, we need to insert records in the auth tables 
using specific id's.  On sqlite this is no problem, but in mssql we get an 
error saying insert_identity is off.
The solution is to set insert_identity in, but I am not sure how to do this 
using the web2py DAL.  Can any give me an code example for this?
We are basically inserting user and group records using ids from a master table.

Thanks, 
David 

-- 
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/bdaa9fde-4d70-4108-b4ff-a877a66f3d72%40googlegroups.com.


[web2py] Re: mssql set identity_insert on

2019-12-20 Thread Davidiam
I agree that this is not good practice, but it is the only workable solution 
that we have found for multi pillar release.

We are also heavily using roles, but here the problem is guaranteeing that 
users have the same ids on all pillars, otherwise we risk users belonging to 
the wrong groups in production

I have found a work around to the insert problem by reserving a range of user 
records and doing updates instead of inserts; also not a clean solution. 

-- 
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/9e15be13-0b69-4885-a4ae-62d4d03be5ee%40googlegroups.com.


[web2py] How to run a specific application instead of welcome in Pycharm Pro

2020-01-22 Thread Davidiam
I am using Pycharm Professional for web2py development.  When I create a 
project with an application "XYZ" and I click run, web2py is started and 
goes directly to the "welcome" app, and not the app "XYZ".  I can navigate 
to the application "XYZ", but I would like it to go directly to this app 
when I click the run button.

I see that I can modify the command line for used for running eb2py, but I 
can't find any parameter combination to force it t go directly to the 
application "XYZ".

Does anyone know this can be accomplished without having t modify the code 
or routes.py ?

Thanks in advance!


-- 
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/138e6104-0c25-4b86-ae34-553f908da60e%40googlegroups.com.


[web2py] How to use conda installed packages in web2py

2020-02-21 Thread Davidiam
Hi,

We have an application that requires the pandas package.  We thought we 
could just install pandas in the conda environment used for running web2py, 
but when we do "import pandas" in web2py we get an error message that it 
can't find pandas and it seems to be looking for pandas in the modules 
folder of the application.

There are a few similar questions that I found on Google but none of them 
had a clear answer.  Is it possible to import conda installed libraries in 
web2py applications without having to copy them (and all dependances) to 
within the web2py framework ?
If so, how can we do this ?


Here is the error we are getting :



web2py Web Framework

Created by Massimo Di Pierro, Copyright 2007-2020

Version 2.18.5-stable+timestamp.2019.04.08.04.22.03

Database drivers available: sqlite3, imaplib, pymysql, pyodbc

['', 'D:\\Data\\QFG\\site-packages', 'D:\\Data\\QFG', '
D:\\Data\\QFG\\gluon\\packages\\yatl', 'D:\\Data\\QFG\\gluon\\packages\\dal', 
'D:\\Python\\Miniconda3\\python37.zip', 'D:\\Python\\Miniconda3\\DLLs', '
D:\\Python\\Miniconda3\\lib', 'D:\\Python\\Miniconda3', '
D:\\Python\\Miniconda3\\lib\\site-packages', '
D:\\Python\\Miniconda3\\lib\\site-packages\\win32', '
D:\\Python\\Miniconda3\\lib\\site-packages\\win32\\lib', '
D:\\Python\\Miniconda3\\lib\\site-packages\\Pythonwin', '
D:\\Python\\Miniconda3\\envs\\web2py_QFG\\Lib\\site-packages']


Traceback (most recent call last):

  File "D:\Data\QFG\gluon\shell.py", line 275, in run

execfile(startfile, _env)

  File "D:\Data\QFG\gluon\shell.py", line 41, in execfile

exec(code, global_vars, local_vars)

  File "D:\Data\QFG\APPLiCATIONS\REPORTING\TEST\PythonInfo.py", line 14, in 


import pandas

  File "D:\Data\QFG\gluon\custom_import.py", line 85, in custom_importer

return base_importer(pname, globals, locals, fromlist, level)

*ModuleNotFoundError: No module named 'applications.CRE.modules.pandas'* 

 

 ---

Kind Regards,
David Rosalia

-- 
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/c4f5e113-9324-4578-b534-d1414a6aad2d%40googlegroups.com.


[web2py] Making the application name variable in the link in routes.py

2020-04-17 Thread Davidiam
Is there a way of referencing the current application in the routes.py as a 
variable ?

For example,  We have the following code in our routes.py :

error_message_ticket = ('Internal errorTicket issued:'
 '%(ticket)s'
 'ERROR DETECTED'
 '')
Our developers don't have access to the admin console in production so they 
can't access the error messages.
I put the error messages on the application level, but I would then need to 
have the application as a variable in the routes.py :


error_message_ticket = (



*'Internal errorTicket issued:' 
'%(ticket)s' 'ERROR 
DETECTED'** ''*)

I see that the %(ticket) variable contains the application at the beginning of 
it's string so I think this should be possible.
Does anyone know if such a variable exists or how this could be done ?

Kind Regards,
David


-- 
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/3935c800-4d11-4f98-9f72-9607b54b81eb%40googlegroups.com.


[web2py] On Windows I am trying to delete an application that uses logging but the delete fails because the log file is "in use"

2020-10-23 Thread Davidiam
When using logging in web2py on Windows, we are unable to delete 
applications unless we first stop the server.

The reason is that the app.log is considered "in use".

As the uninstall happens from the admin app, I am not quite sure how best 
to stop the logger in the application that is being uninstalled when the 
"Uninstall" option is selected from admin.  

Anyone have any ideas on how to unistall an app that uses logging.  
Apparently this is only an issue on Windows because the os.unlink works on 
"in use" files on linux systems.

Note : We have defined the location of the log files within the application 
directory structure so that the developers have access to the files.

This is the logging code used :
def get_configured_logger(name):
Test = False
logger = logging.getLogger(name)
if (len(logger.handlers) == 0):
# This logger has no handlers, so we can assume it hasn't yet been 
configured
# (Configure logger)

# Create default handler
if request.env.web2py_runtime_gae:
# Create GAEHandler
handler = GAEHandler()
else:
# Create RotatingFileHandler
import os
formatter="%(asctime)s %(levelname)s %(process)s %(thread)s 
%(funcName)s():%   (lineno)d %(message)s"
handler = 
logging.handlers.RotatingFileHandler(os.path.join(request.folder,
'private/app.log'), maxBytes=100,backupCount=2)
handler.setFormatter(logging.Formatter(formatter))

handler.setLevel(logging.DEBUG)

logger.addHandler(handler)
logger.setLevel(logging.DEBUG)

# Test entry:

if Test == True:
logger.debug(name + ' logger created')
else:
# Test entry:
if Test == True:
logger.debug(name + ' already exists')

return logger

-- 
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/c9b3c32c-6cfc-4b5f-9894-a62d16898ea5n%40googlegroups.com.


Re: [web2py] On Windows I am trying to delete an application that uses logging but the delete fails because the log file is "in use"

2020-10-27 Thread Davidiam
It looks like it uses one handler although the logger rotates the actual 
log files.  I think that I would need to shut down the logger before or at 
the beginning of the uninstall step, but as the "uninstall application" is 
run from the admin app, it would be a bit tricky to implement the shutdown 
for a specific application in the admin application code.  If there was an 
app.shutdown() method maybe

For the moment I am first shutting down the application pool in IIS and 
then deleting the app but I would prefer a coded solution.  We son't delete 
applications aften, so the work-around is acceptable for the moment.

On Tuesday, October 27, 2020 at 4:23:09 AM UTC+1 roge...@gmail.com wrote:

> Ah, i see. Can you temporarily shutdown() the logger and then restart it 
> when the uninstall is complete? Or does it need to stay running also? I 
> think it is possible to close a specific handler as well - but i dont know 
> how the logging works in web2py - maybe there is a single handler for all 
> the apps (if you can't tell, i have never used it before :)
>
>
> ___
> *www.TenOutOfTen.org* <https://www.TenOutOfTen.org>
> roge...@gmail.com
> (+95) 09 250018669 <+95%209%20250%20018%20669> (Myanmar)
>
>
> On Mon, 26 Oct 2020 at 23:37, Davidiam  wrote:
>
>> Thank you for your reply,  
>> Deleting the application folder gives the same error.  
>> The problem is that the logger holds the log file locked.  If I restart 
>> the webserver I can delete the file, but our developers can't restart web 
>> services.
>> It is not a big problem but I would like to find a solution (if one 
>> exists)..
>>
>> On Monday, October 26, 2020 at 4:56:30 AM UTC+1 roge...@gmail.com wrote:
>>
>>> Hi David
>>>
>>> I am not sure that i have ever used the Uninstall option. I just delete 
>>> the application folder and the application disappears. I am not sure if 
>>> that leaves any residual information in files somewhere. But i have not 
>>> noticed a problem.
>>>
>>> Does that work for you?
>>> Andrew
>>>
>>> ___
>>> *www.TenOutOfTen.org* <https://www.TenOutOfTen.org>
>>> roge...@gmail.com
>>> (+95) 09 250018669 <+95%209%20250%20018%20669> (Myanmar)
>>>
>>>
>>>
>>> On Fri, 23 Oct 2020 at 17:07, Davidiam  wrote:
>>>
>>>> When using logging in web2py on Windows, we are unable to delete 
>>>> applications unless we first stop the server.
>>>>
>>>> The reason is that the app.log is considered "in use".
>>>>
>>>> As the uninstall happens from the admin app, I am not quite sure how 
>>>> best to stop the logger in the application that is being uninstalled when 
>>>> the "Uninstall" option is selected from admin.  
>>>>
>>>> Anyone have any ideas on how to unistall an app that uses logging.  
>>>> Apparently this is only an issue on Windows because the os.unlink works on 
>>>> "in use" files on linux systems.
>>>>
>>>> Note : We have defined the location of the log files within the 
>>>> application directory structure so that the developers have access to the 
>>>> files.
>>>>
>>>> This is the logging code used :
>>>> def get_configured_logger(name):
>>>> Test = False
>>>> logger = logging.getLogger(name)
>>>> if (len(logger.handlers) == 0):
>>>> # This logger has no handlers, so we can assume it hasn't yet been 
>>>> configured
>>>> # (Configure logger)
>>>>
>>>> # Create default handler
>>>> if request.env.web2py_runtime_gae:
>>>> # Create GAEHandler
>>>> handler = GAEHandler()
>>>> else:
>>>> # Create RotatingFileHandler
>>>> import os
>>>> formatter="%(asctime)s %(levelname)s %(process)s %(thread)s 
>>>> %(funcName)s():%   (lineno)d %(message)s"
>>>> handler = 
>>>> logging.handlers.RotatingFileHandler(os.path.join(request.folder,
>>>> 'private/app.log'), maxBytes=100,backupCount=2)
>>>> handler.setFormatter(logging.Formatter(formatter))
>>>>
>>>> handler.setLevel(logging.DEBUG)
>>>>
>>>> logger.addHandler(handler)
>>>> logger.setLevel(logging.DEBUG)
>>>>
>>>> # Test entry:
>>>>
>>>> if Test == Tru

Re: [web2py] On Windows I am trying to delete an application that uses logging but the delete fails because the log file is "in use"

2020-10-26 Thread Davidiam
Thank you for your reply,  
Deleting the application folder gives the same error.  
The problem is that the logger holds the log file locked.  If I restart the 
webserver I can delete the file, but our developers can't restart web 
services.
It is not a big problem but I would like to find a solution (if one 
exists)..

On Monday, October 26, 2020 at 4:56:30 AM UTC+1 roge...@gmail.com wrote:

> Hi David
>
> I am not sure that i have ever used the Uninstall option. I just delete 
> the application folder and the application disappears. I am not sure if 
> that leaves any residual information in files somewhere. But i have not 
> noticed a problem.
>
> Does that work for you?
> Andrew
>
> ___
> *www.TenOutOfTen.org* <https://www.TenOutOfTen.org>
> roge...@gmail.com
> (+95) 09 250018669 <+95%209%20250%20018%20669> (Myanmar)
>
>
>
> On Fri, 23 Oct 2020 at 17:07, Davidiam  wrote:
>
>> When using logging in web2py on Windows, we are unable to delete 
>> applications unless we first stop the server.
>>
>> The reason is that the app.log is considered "in use".
>>
>> As the uninstall happens from the admin app, I am not quite sure how best 
>> to stop the logger in the application that is being uninstalled when the 
>> "Uninstall" option is selected from admin.  
>>
>> Anyone have any ideas on how to unistall an app that uses logging.  
>> Apparently this is only an issue on Windows because the os.unlink works on 
>> "in use" files on linux systems.
>>
>> Note : We have defined the location of the log files within the 
>> application directory structure so that the developers have access to the 
>> files.
>>
>> This is the logging code used :
>> def get_configured_logger(name):
>> Test = False
>> logger = logging.getLogger(name)
>> if (len(logger.handlers) == 0):
>> # This logger has no handlers, so we can assume it hasn't yet been 
>> configured
>> # (Configure logger)
>>
>> # Create default handler
>> if request.env.web2py_runtime_gae:
>> # Create GAEHandler
>> handler = GAEHandler()
>> else:
>> # Create RotatingFileHandler
>> import os
>> formatter="%(asctime)s %(levelname)s %(process)s %(thread)s 
>> %(funcName)s():%   (lineno)d %(message)s"
>> handler = 
>> logging.handlers.RotatingFileHandler(os.path.join(request.folder,
>> 'private/app.log'), maxBytes=100,backupCount=2)
>> handler.setFormatter(logging.Formatter(formatter))
>>
>> handler.setLevel(logging.DEBUG)
>>
>> logger.addHandler(handler)
>> logger.setLevel(logging.DEBUG)
>>
>> # Test entry:
>>
>> if Test == True:
>> logger.debug(name + ' logger created')
>> else:
>> # Test entry:
>> if Test == True:
>> logger.debug(name + ' already exists')
>>
>> return logger
>>
>> -- 
>> 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+un...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/web2py/c9b3c32c-6cfc-4b5f-9894-a62d16898ea5n%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/web2py/c9b3c32c-6cfc-4b5f-9894-a62d16898ea5n%40googlegroups.com?utm_medium=email_source=footer>
>> .
>>
>

-- 
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/4af7b1b3-1161-4252-80fe-0f89e125db82n%40googlegroups.com.


[web2py] Re: We use web2p 2.18.5 with MS SQL on Windows IIS 10. Recently a security patch on the server enforced stricter SSL rules and we can no longer use TLS 1.0 and 1.1. so it has to be TLS 1.2

2020-06-22 Thread Davidiam
UPDATE : I managed to find the solution so I will post it here for any 
others that have the same issue :

We had to instrall a new ODBC driver and to modify the MS SQL connection 
string.

Old string :

uri   = mssql://DRIVER={SQL Server}

 

New string :

uri   = mssql://DRIVER={ODBC Driver 13 for SQL Server}

 

We then ran into problems with web2py trying to recreate the auth tables 
which already existed.   

gluon.contrib.pypyodbc.ProgrammingError: ('42S01', "[42S01] 
[Microsoft][ODBC Driver 13 for SQL Server][SQL Server]There is already an 
object named 'auth_user' in the database.")

 

I found that this error message was somehow related to the files in the 
databases folder within the application on the web2py server.  

I thought that this folder was only used when connecting to a MySQL 
database,  but I now see that it is also referenced somewhere for the auth 
tables when using a shared MS SQL database.

 

As a test, I renamed the databases folder under the web2py application (as 
a backup), and then copied over a databases folder from a freshly created 
web2py application.  I then ran my MSSQL web2py application and it ran 
correctly.

 

Hope this helps someone ;)


On Friday, June 19, 2020 at 7:44:53 AM UTC+2, Davidiam wrote:
>
> Good Morning,
>
> I would like to know what I would have to modify in order to connect to MS 
> SQL from web2py with TLS 1.2.  We are running web2py 2.18.5 on a Windows 
> 2016 IIS server.
>
> Yesterday a security patch was installed to disable TLS 1.0 and 1.1 and 
> enable TLS 1.2 and now all our MS SQL DB connections are failing.
>
> Thank you very much for your help on this, I would appreciate a rapid 
> reply as our development in web2py is now blocked due to this.
>
> Kind Regards,
> David
>

-- 
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/851176bc-d7a9-4faf-ad0f-d28e47ccf28eo%40googlegroups.com.


[web2py] Re: We use web2p 2.18.5 with MS SQL on Windows IIS 10. Recently a security patch on the server enforced stricter SSL rules and we can no longer use TLS 1.0 and 1.1. so it has to be TLS 1.2

2020-06-22 Thread Davidiam
Sorry, I thought the post on top was only for me, I didn't know it was for 
everyone :S


On Saturday, June 20, 2020 at 4:16:33 AM UTC+2, Dave S wrote:
>
>
>
> On Thursday, June 18, 2020 at 10:44:53 PM UTC-7, Davidiam wrote:
>>
>> Good Morning,
>>
>> I would like to know what I would have to modify in order to connect to 
>> MS SQL from web2py with TLS 1.2.  We are running web2py 2.18.5 on a Windows 
>> 2016 IIS server.
>>
>> Yesterday a security patch was installed to disable TLS 1.0 and 1.1 and 
>> enable TLS 1.2 and now all our MS SQL DB connections are failing.
>>
>> Thank you very much for your help on this, I would appreciate a rapid 
>> reply as our development in web2py is now blocked due to this.
>>
>> Kind Regards,
>> David
>>
>
> I don't think I can help you; I'm not on either IIS or MSSQL.  One of our 
> long-time experts and contributors   Niphlod's (er, Stephane) was involved 
> with IIS environments, so web2py has been well wrung out on IIS, but he's 
> been busy elsewhere lately.
>
> BTW, please don't be confused by Google Groups form having a check-box for 
> "show on top".  In this group, that is used primariy for major 
> announcements, usually by Massimo, such as the "New py4web group" post.  
> Since GG defaults to showing posts in order of recent activity, new posts 
> are near the top anyway.
>
> /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/438ee9d5-3f7c-41ec-a6c1-6be09b5910b7o%40googlegroups.com.


[web2py] We use web2p 2.18.5 with MS SQL on Windows IIS 10. Recently a security patch on the server enforced stricter SSL rules and we can no longer use TLS 1.0 and 1.1. so it has to be TLS 1.2

2020-06-18 Thread Davidiam
Good Morning,

I would like to know what I would have to modify in order to connect to MS 
SQL from web2py with TLS 1.2.  We are running web2py 2.18.5 on a Windows 
2016 IIS server.

Yesterday a security patch was installed to disable TLS 1.0 and 1.1 and 
enable TLS 1.2 and now all our MS SQL DB connections are failing.

Thank you very much for your help on this, I would appreciate a rapid reply 
as our development in web2py is now blocked due to this.

Kind Regards,
David

-- 
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/e03e78e7-24fd-494c-ab66-47f899260c82o%40googlegroups.com.


Re: [web2py] We use web2p 2.18.5 with MS SQL on Windows IIS 10. Recently a security patch on the server enforced stricter SSL rules and we can no longer use TLS 1.0 and 1.1. so it has to be TLS 1.2

2020-06-19 Thread Davidiam
The reason that I put it here is that that web2py pydal uses the pyodbc 
driver and I thought that there may be version requirements or connection 
parameters that would resolve this.
I will now also look at the link that you sent.

On Friday, June 19, 2020 at 9:35:30 AM UTC+2, Nico Zanferrari wrote:
>
> Hi David,
>
> if I understand right you are not anymore able to connect to an external 
> MS SQL database from a Windows server. This does not seem a web2py issue ;-)
>
> Anyhow, have you checked that your web2py server and your  external MS SQL 
> database are compatible with TLS 1.2? Have you verified it? See here 
> <https://social.technet.microsoft.com/Forums/en-US/a8fbb819-02c0-4b42-b593-0282605732f1/how-to-confirm-sql-connection-is-using-tls-12>
>  
> for details. 
>
> Nico
>
>
> Il giorno ven 19 giu 2020 alle ore 07:45 Davidiam  > ha scritto:
>
>> Good Morning,
>>
>> I would like to know what I would have to modify in order to connect to 
>> MS SQL from web2py with TLS 1.2.  We are running web2py 2.18.5 on a Windows 
>> 2016 IIS server.
>>
>> Yesterday a security patch was installed to disable TLS 1.0 and 1.1 and 
>> enable TLS 1.2 and now all our MS SQL DB connections are failing.
>>
>> Thank you very much for your help on this, I would appreciate a rapid 
>> reply as our development in web2py is now blocked due to this.
>>
>> Kind Regards,
>> David
>>
>> -- 
>> 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/e03e78e7-24fd-494c-ab66-47f899260c82o%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/web2py/e03e78e7-24fd-494c-ab66-47f899260c82o%40googlegroups.com?utm_medium=email_source=footer>
>> .
>>
>

-- 
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/bd3335e9-c0e6-4fdb-9eaa-5ee210deaa37o%40googlegroups.com.


Re: [web2py] On Windows I am trying to delete an application that uses logging but the delete fails because the log file is "in use"

2020-11-10 Thread Davidiam
We found that by modifying the gluon\admin.py app_uninstall function, we 
could search for the open log file handles and close them before the actual 
delete of the files is performed. 

   import logging
   import logging.handlers

   for nm, lgr in logging.root.manager.loggerDict.items():
  if str(nm) == str(app):
 for h in lgr.handlers:
h.close()
On Tuesday, October 27, 2020 at 2:09:51 PM UTC+1 Davidiam wrote:

> It looks like it uses one handler although the logger rotates the actual 
> log files.  I think that I would need to shut down the logger before or at 
> the beginning of the uninstall step, but as the "uninstall application" is 
> run from the admin app, it would be a bit tricky to implement the shutdown 
> for a specific application in the admin application code.  If there was an 
> app.shutdown() method maybe
>
> For the moment I am first shutting down the application pool in IIS and 
> then deleting the app but I would prefer a coded solution.  We son't delete 
> applications aften, so the work-around is acceptable for the moment.
>
> On Tuesday, October 27, 2020 at 4:23:09 AM UTC+1 roge...@gmail.com wrote:
>
>> Ah, i see. Can you temporarily shutdown() the logger and then restart it 
>> when the uninstall is complete? Or does it need to stay running also? I 
>> think it is possible to close a specific handler as well - but i dont know 
>> how the logging works in web2py - maybe there is a single handler for all 
>> the apps (if you can't tell, i have never used it before :)
>>
>>
>> ___
>> *www.TenOutOfTen.org* <https://www.TenOutOfTen.org>
>> roge...@gmail.com
>> (+95) 09 250018669 <+95%209%20250%20018%20669> (Myanmar)
>>
>>
>> On Mon, 26 Oct 2020 at 23:37, Davidiam  wrote:
>>
>>> Thank you for your reply,  
>>> Deleting the application folder gives the same error.  
>>> The problem is that the logger holds the log file locked.  If I restart 
>>> the webserver I can delete the file, but our developers can't restart web 
>>> services.
>>> It is not a big problem but I would like to find a solution (if one 
>>> exists)..
>>>
>>> On Monday, October 26, 2020 at 4:56:30 AM UTC+1 roge...@gmail.com wrote:
>>>
>>>> Hi David
>>>>
>>>> I am not sure that i have ever used the Uninstall option. I just delete 
>>>> the application folder and the application disappears. I am not sure if 
>>>> that leaves any residual information in files somewhere. But i have not 
>>>> noticed a problem.
>>>>
>>>> Does that work for you?
>>>> Andrew
>>>>
>>>> ___
>>>> *www.TenOutOfTen.org* <https://www.TenOutOfTen.org>
>>>> roge...@gmail.com
>>>> (+95) 09 250018669 <+95%209%20250%20018%20669> (Myanmar)
>>>>
>>>>
>>>>
>>>> On Fri, 23 Oct 2020 at 17:07, Davidiam  wrote:
>>>>
>>>>> When using logging in web2py on Windows, we are unable to delete 
>>>>> applications unless we first stop the server.
>>>>>
>>>>> The reason is that the app.log is considered "in use".
>>>>>
>>>>> As the uninstall happens from the admin app, I am not quite sure how 
>>>>> best to stop the logger in the application that is being uninstalled when 
>>>>> the "Uninstall" option is selected from admin.  
>>>>>
>>>>> Anyone have any ideas on how to unistall an app that uses logging.  
>>>>> Apparently this is only an issue on Windows because the os.unlink works 
>>>>> on 
>>>>> "in use" files on linux systems.
>>>>>
>>>>> Note : We have defined the location of the log files within the 
>>>>> application directory structure so that the developers have access to the 
>>>>> files.
>>>>>
>>>>> This is the logging code used :
>>>>> def get_configured_logger(name):
>>>>> Test = False
>>>>> logger = logging.getLogger(name)
>>>>> if (len(logger.handlers) == 0):
>>>>> # This logger has no handlers, so we can assume it hasn't yet been 
>>>>> configured
>>>>> # (Configure logger)
>>>>>
>>>>> # Create default handler
>>>>> if request.env.web2py_runtime_gae:
>>>>> # Create GAEHandler
>>>>>  

Re: [web2py] Timeout for data entry screens: Help!

2021-02-04 Thread Davidiam
Thanks Massimiliano, I will ask the developer if he can try that.  

We are currently exploring another option using ajax to save all changes 
immediately.  If a form field is changed, it is sanved immediatel via an 
ajax call.

I suspect the timeout may be coming from our Singe Sign-On framework, so we 
need to check that as well.  

Kind Regards,
David

On Friday, January 29, 2021 at 4:13:15 PM UTC+1 Massimiliano wrote:

> Reading better you message, I'm not sure that auth.settings.expiration is 
> what you need. 
> Sorry
>
> Il giorno ven 29 gen 2021 alle ore 16:10 Massimiliano  
> ha scritto:
>
>> You can set:
>>
>> auth.settings.expiration
>>
>> Value are in seconds. So 86400 is one day,
>>
>>
>>
>> Il giorno ven 29 gen 2021 alle ore 14:42 Davidiam  
>> ha scritto:
>>
>>> 2.18.5-stable+timestamp.2019.04.08.04.22.03
>>> (Running on Microsoft-IIS/10.0, Python 3.6.8) 
>>>  
>>> Hello,
>>>
>>> We built some web2py applications and we are now getting feedback from 
>>> the users that if they don't save their data entry screen data within about 
>>> 10 minutes, that the save fails and they have to re-enter all their data.  
>>> As they often get interruptions while entering data, this is becoming a bit 
>>> of a problem.
>>>
>>> Can this "timeout" be modified to give them more time?  Is this coming 
>>> from web2py or would this me more an infrastructure issue?
>>>
>>> Thanks in advance for any replies!
>>> David
>>>
>>> -- 
>>> 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+un...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/web2py/c389ecc4-0693-438d-ae89-ef01660dfb34n%40googlegroups.com
>>>  
>>> <https://groups.google.com/d/msgid/web2py/c389ecc4-0693-438d-ae89-ef01660dfb34n%40googlegroups.com?utm_medium=email_source=footer>
>>> .
>>>
>>
>>
>> -- 
>> Massimiliano
>>
>
>
> -- 
> Massimiliano
>

-- 
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/8d8bb0c7-3cb8-4f76-ad5b-3426447e94acn%40googlegroups.com.


[web2py] Timeout for data entry screens: Help!

2021-01-29 Thread Davidiam
2.18.5-stable+timestamp.2019.04.08.04.22.03
(Running on Microsoft-IIS/10.0, Python 3.6.8) 
 
Hello,

We built some web2py applications and we are now getting feedback from the 
users that if they don't save their data entry screen data within about 10 
minutes, that the save fails and they have to re-enter all their data.  As 
they often get interruptions while entering data, this is becoming a bit of 
a problem.

Can this "timeout" be modified to give them more time?  Is this coming from 
web2py or would this me more an infrastructure issue?

Thanks in advance for any replies!
David

-- 
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/c389ecc4-0693-438d-ae89-ef01660dfb34n%40googlegroups.com.


[web2py] How to add command line arguments to web2py when it is running as an application pool on IIS?

2021-08-27 Thread Davidiam
Hi web2py folks,

I would like to add a command line argument to the startup of web2py which 
is running on an IIS web server.  Can someone tell me the place where I 
need to add those parameters on the IIS?

Kind Regards,
David

-- 
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/71650059-84e6-4f46-8268-c71edc9acca4n%40googlegroups.com.


Re: [web2py] Re: How to add command line arguments to web2py when it is running as an application pool on IIS?

2021-09-01 Thread Davidiam
I would like to increase the timeout parameters to see if it resolves some 
issues we are having with internal server error messages.

Get Outlook for Android

From: web2py@googlegroups.com  on behalf of Niphlod 

Sent: Wednesday, September 1, 2021 10:35:35 AM
To: web2py-users 
Subject: [web2py] Re: How to add command line arguments to web2py when it is 
running as an application pool on IIS?

what command line argument, specifically ?

On Tuesday, August 31, 2021 at 5:59:31 AM UTC+2 snide...@gmail.com wrote:
On Thursday, August 26, 2021 at 11:30:34 PM UTC-7 david@gmail.com wrote:
Hi web2py folks,

I would like to add a command line argument to the startup of web2py which is 
running on an IIS web server.  Can someone tell me the place where I need to 
add those parameters on the IIS?

Kind Regards,
David


I can't, but perhaps the archives can help.  One of the long-time masters, 
Simone, ran IIS configurations and sometimes discussed his setups.  Use the 
search string "https://groups.google.com/g/web2py/search?q=author%3ANiphlod; to 
see his posts.  (There are a lot; he did the Scheduler and also the JWT 
implementation, so you may want to refine the search.)

/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/1ac4efb0-1524-4f03-9370-4ac03da788bfn%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/AM8P193MB0802AFB8DCB723CC6F5AEB59FECD9%40AM8P193MB0802.EURP193.PROD.OUTLOOK.COM.


[web2py] Internal Server Error 500 when doing medium to heavy data processing

2021-08-26 Thread Davidiam
Version

2.18.5-stable+timestamp.2019.04.08.04.22.03
(Running on Microsoft-IIS/10.0, Python 3.6.8)

Hello,

We have been using web2py for a couple of years with very few issues, but 
lately we have been getting *Internal Server Error 500 *error messages when 
certain scripts are called.  These scripts due some relatively heavy 
processing.

I am not sure if this is related to web2py or purely a server, resource or 
network problem but I thought that someone here may have had similar issues 
and can recommend some configuration change to remedy this.

Kind Regards, 

David

-- 
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/7e70675f-7887-4b8a-964c-95e3a3d759c4n%40googlegroups.com.


Re: [web2py] Re: How to add command line arguments to web2py when it is running as an application pool on IIS?

2021-09-06 Thread Davidiam
Thanks, I was out for a week and just see your reply now.  I will try that.

On Thursday, September 2, 2021 at 9:34:56 AM UTC+2 Niphlod wrote:

> the timeout is part of rocket webserver, not web2py. if you're running 
> fastcgi, that's where you want to set a timeout: as configuration in IIS 
> (see  python - How do I stop FastCGI process exceeding the configured 
> request timeout - Stack Overflow 
> 
>   
> or something like that )
>
> On Wednesday, September 1, 2021 at 11:12:29 AM UTC+2 david@gmail.com 
> wrote:
>
>> I would like to increase the timeout parameters to see if it resolves 
>> some issues we are having with internal server error messages. 
>>
>> Get Outlook for Android 
>> --
>> *From:* web...@googlegroups.com  on behalf of 
>> Niphlod 
>> *Sent:* Wednesday, September 1, 2021 10:35:35 AM
>> *To:* web2py-users 
>> *Subject:* [web2py] Re: How to add command line arguments to web2py when 
>> it is running as an application pool on IIS? 
>>  
>> what command line argument, specifically ?
>>
>> On Tuesday, August 31, 2021 at 5:59:31 AM UTC+2 snide...@gmail.com wrote:
>>
>> On Thursday, August 26, 2021 at 11:30:34 PM UTC-7 david@gmail.com 
>> wrote:
>>
>> Hi web2py folks, 
>>
>> I would like to add a command line argument to the startup of web2py 
>> which is running on an IIS web server.  Can someone tell me the place where 
>> I need to add those parameters on the IIS?
>>
>> Kind Regards,
>> David
>>
>>
>>
>> I can't, but perhaps the archives can help.  One of the long-time 
>> masters, Simone, ran IIS configurations and sometimes discussed his 
>> setups.  Use the search string "
>> https://groups.google.com/g/web2py/search?q=author%3ANiphlod; to see his 
>> posts.  (There are a lot; he did the Scheduler and also the JWT 
>> implementation, so you may want to refine the search.) 
>>
>> /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+un...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/web2py/1ac4efb0-1524-4f03-9370-4ac03da788bfn%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/7e085126-93b9-4eb0-be06-1c201dedc645n%40googlegroups.com.


Re: [web2py] Re: How to add command line arguments to web2py when it is running as an application pool on IIS?

2021-09-10 Thread Davidiam
We tried the parameters that were recommended in the link of @Niphlod 's 
post, but the error is still occurring.  What is strange is the error 
occurs after only about 3 seconds, so there may be something else happening 
here.

I will try to get the developer to comment on this thread as he knows best 
what he is doing.

Kind Regards,
David

On Thursday, September 2, 2021 at 9:34:56 AM UTC+2 Niphlod wrote:

> the timeout is part of rocket webserver, not web2py. if you're running 
> fastcgi, that's where you want to set a timeout: as configuration in IIS 
> (see  python - How do I stop FastCGI process exceeding the configured 
> request timeout - Stack Overflow 
> 
>   
> or something like that )
>
> On Wednesday, September 1, 2021 at 11:12:29 AM UTC+2 david@gmail.com 
> wrote:
>
>> I would like to increase the timeout parameters to see if it resolves 
>> some issues we are having with internal server error messages. 
>>
>> Get Outlook for Android 
>> --
>> *From:* web...@googlegroups.com  on behalf of 
>> Niphlod 
>> *Sent:* Wednesday, September 1, 2021 10:35:35 AM
>> *To:* web2py-users 
>> *Subject:* [web2py] Re: How to add command line arguments to web2py when 
>> it is running as an application pool on IIS? 
>>  
>> what command line argument, specifically ?
>>
>> On Tuesday, August 31, 2021 at 5:59:31 AM UTC+2 snide...@gmail.com wrote:
>>
>> On Thursday, August 26, 2021 at 11:30:34 PM UTC-7 david@gmail.com 
>> wrote:
>>
>> Hi web2py folks, 
>>
>> I would like to add a command line argument to the startup of web2py 
>> which is running on an IIS web server.  Can someone tell me the place where 
>> I need to add those parameters on the IIS?
>>
>> Kind Regards,
>> David
>>
>>
>>
>> I can't, but perhaps the archives can help.  One of the long-time 
>> masters, Simone, ran IIS configurations and sometimes discussed his 
>> setups.  Use the search string "
>> https://groups.google.com/g/web2py/search?q=author%3ANiphlod; to see his 
>> posts.  (There are a lot; he did the Scheduler and also the JWT 
>> implementation, so you may want to refine the search.) 
>>
>> /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+un...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/web2py/1ac4efb0-1524-4f03-9370-4ac03da788bfn%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/1db2f35f-9a09-4fda-9928-629bb5ab36c3n%40googlegroups.com.


[web2py] A friend has developed a flask application and now wants to add a login and security. I would like to know if it would be feasible to convert the flask application to web2py.

2021-09-26 Thread Davidiam
A friend asked me if I would be interested in building the login/security 
layer for a flask / My SQL application on PyhtonAnywhere, but I don't know 
Flask and I really like web2py and have already created a few applications 
using web2py.

I told her that web2py has the security included and if it wasn't too much 
work, it may be easier to move the application to web2py and I told her I 
would try to find out how much work that would be.

So basically I would like to know how difficult it would be to convert a 
Flask-MySQL application to web2py.  Would the general structure of the 
application be the same?  It is a newly developed application and not very 
heavy in code, but has quite a bit of data.   

Py4web would of course also be an option but I have not used that yet so 
there would probably be a small learning curve involved.  I suspect Py4web 
would give better performance.

Kind Regards,
David

-- 
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/3c299169-b1c0-4c1a-9a98-9ae99bf49d25n%40googlegroups.com.


[web2py] PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'D:\\Data\\XYZ\\applications\\MyApp\\private\\app.log'

2023-08-23 Thread Davidiam
We have activated logging in our applications and have defined 2 back-ups 
for the rotation.

We often get errors when running web2py shell scripts because I think that 
the the web2py web application and the web2py shell script are both trying 
to access the log file.  It looks like it is trying to perform a rotation 
at the moment of the error.

Can anyone give me an idea on how we can resolve with this conflict without 
disabling rotation?

Here is the full output:
--- Logging error ---
Traceback (most recent call last):
  File "D:\Python\Miniconda3\envs\web2py_XYZ\lib\logging\handlers.py", line 
74, in emit
self.doRollover()
  File "D:\Python\Miniconda3\envs\web2py_XYZ\lib\logging\handlers.py", line 
177, in doRollover
self.rotate(self.baseFilename, dfn)
  File "D:\Python\Miniconda3\envs\web2py_XYZ\lib\logging\handlers.py", line 
115, in rotate
os.rename(source, dest)
PermissionError: [WinError 32] The process cannot access the file because 
it is being used by another process: 
'D:\\Data\\XYZ\\applications\\MyApp\\private\\app.log' -> 
'D:\\Data\\XYZ\\applications\\MyApp\\private\\app.log.1'
Call stack:
  File "D:\Data\XYZ\web2py.py", line 58, in 
gluon.widget.start()
  File "D:\Data\XYZ\gluon\widget.py", line 746, in start
run(options.shell, plain=options.plain, bpython=options.bpython,
  File "D:\Data\XYZ\gluon\shell.py", line 280, in run
_env = env(a, c=c, f=f, import_models=import_models, 
extra_request=extra_request)
  File "*D:\Data\XYZ\gluon\shell.py"*, line 181, in env
run_models_in(environment)
  File "D:\Data\XYZ\gluon\compileapp.py", line 563, in run_models_in
restricted(ccode, environment, layer=model)
  File "D:\Data\XYZ\gluon\restricted.py", line 219, in restricted
exec(ccode, environment)
  File "applications\MyApp\models\b_console.py", line 153, in 
console.log(source='b_console.py', message=str(console), 
add_timestamp=True)
  File "applications\MyApp\models\b_console.py", line 147, in log
logger.debug(msg=out_log)

Thanks in advance,
David

-- 
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/02c810ee-98e8-498b-acca-b7f389b6d3fbn%40googlegroups.com.


Re: [web2py] Re: Latest version of web2py and python versions

2022-12-30 Thread Davidiam
Thanks !

Sent from Outlook for Android

From: web2py@googlegroups.com  on behalf of Leonel 
Câmara 
Sent: Wednesday, December 28, 2022 5:14:56 PM
To: web2py-users 
Subject: [web2py] Re: Latest version of web2py and python versions

You can use a higher python version it's fine.

A quarta-feira, 21 de dezembro de 2022 à(s) 06:19:40 UTC, david@gmail.com 
escreveu:
Good morning,

Can anyone tell me if the latest version of web2py was specifically developed 
for any specific python version or range of python versions?

After years of using an older version, and being limited to the version 3.6, we 
will be upgrading to the most recent version of web2py, and I will need to 
recommend a version of python to the different development groups.

python 3.7 will be out of support soon, so I would ideally like to move to 
python 3.9 or 3.10.  I did a test with 3.9 yesterday and all my applications 
worked fine, but I just wanted to be sure that the version was meant to be used 
with these higher versions.

Kind Regards,
David

--
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/9bf3ab26-125f-4a6e-81c5-1bb6f206f91fn%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/AM8P193MB08020AB4AAEBDC34D2B97014FEF19%40AM8P193MB0802.EURP193.PROD.OUTLOOK.COM.


[web2py] web2py 2.23.0 is giving a 403 error when I try to package my applications

2023-01-05 Thread Davidiam
I are using IIS 10 with web2py 2.23.0.

When I try to pack the welcome application (or any other), using pack_all I 
get a 403 error.
When I try to pack the welcome application (or any other), using 
pack_custom, it first displays the file selector and when I click on 
download as .w2p I get a 403 error.

This seems to be related to the open_redirect changes.  I tried putting the 
403 error related code from the admin\default.py controller in comment, but 
it still is giving the error.

Kind Regards,
David

-- 
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/1205772f-0877-4f44-927b-e8830390c05en%40googlegroups.com.


[web2py] web2py 2.23.0 is giving a 403 error when I try to package my applications

2023-01-05 Thread Davidiam
Good Morning,

We are using IIS 10 with web2py 2.23.0.

When I try to pack the welcome application (or any other), using pack_all I 
get a 403 error.
When I try to pack the welcome application (or any other), using 
pack_custom, it first displays the file selector and when I click on 
download as .w2p I get a 403 error.

This seems to be related to the open_redirect changes.  I tried putting the 
403 error related code from the admin\default.py controller in comment, but 
it still is giving the error.  

Kind Regards,
David

-- 
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/75f4db14-d286-4bb6-9f41-a815c093d6a8n%40googlegroups.com.


[web2py] Re: Upgraded to 2.19 and SQL Server date insert throws an error

2023-01-11 Thread Davidiam
Hi,

Has anyone found a solution for this?  We are experiencing the same issue 
with 2.22.5 and storing the session in the db. 
As a work-around, we have removed the ".isoformat" from the line 1247 of 
the gluon\globals.py:

modified_datetime=request.now, #.isoformat(),

What would be the impact of our work-around?  If we put isoformat in 
comment, the modified_datetime will be a string instead of a datetime 
object.

On Thursday, June 4, 2020 at 6:30:30 AM UTC+2 Seth J wrote:

> Thanks for pointing the function.  But it looks like the error is 
> happening on the Session insert. See below *query* block:
>
>
>
>- Variables
>e DataError('22007', '[22007] [Microsoft][ODBC SQL...e from character 
>string. (241) (SQLExecDirectW)')
>
> Context
>
> locals request session response
> locals
> e : DataError('22007', '[22007] [Microsoft][ODBC SQL...e from character 
> string. (241) (SQLExecDirectW)')
> fields : [(, '172.20.252.61'), 
> (, 0), (, 
> '2020-06-04T00:21:23.665000'), (, 
> '5258b356-2b72-4a24-8868-710222ac0784'), (, 
> datetime.datetime(2020, 6, 4, 0, 21, 23, 665000)), ( object>, 
> '\x80\x02cgluon.globals\nSession\nq\x01}q\x02U\x05flashq\x03U\x00s\x85Rq\x04.')]
> query : 'INSERT INTO 
> "web2py_session_PubView"("client_ip"...FscwpTZXNzaW9uCnEBfXECVQVmbGFzaHEDVQBzhVJxBC4=\');'
> self : 
> table :
>  unique_key, session_data)>
>
> On Wednesday, June 3, 2020 at 11:09:28 PM UTC-4, Dave S wrote:
>>
>>
>>
>> On Wednesday, June 3, 2020 at 2:04:02 PM UTC-7, Seth J wrote:
>>>
>>> I am not sure how to view the query sent to MSSQL.  
>>>
>>
>> Does this help/?
>> > https://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#_lastsql
>> >
>>
>>
>>  
>>
>>> Here's a little more from the error record:
>>>
>>>
>>>- 
>>>
>>>*File C:\inetpub\wwwroot\gluon\packages\dal\pydal\adapters\base.py 
>>>in insert at line 539* code arguments variables
>>>Function argument list
>>>
>>>(self=, table=>>web2py_session_PubView (id, locked, clien...me, modified_datetime, 
>>>unique_key, session_data)>, fields=[(, 
>>>'172.20.145.208'), (, 0), 
>>> (>>object>, '2020-06-03T00:26:05.296000'), (, 
>>>'affc9c47-0085-45dc-8352-12549c7f93dc'), (, 
>>>datetime.datetime(2020, 6, 3, 0, 26, 5, 296000)), (>>object>, 
>>>
>>> '\x80\x02cgluon.globals\nSession\nq\x01}q\x02U\x05flashq\x03U\x00s\x85Rq\x04.')])
>>>
>>>
>> You've got a date conversion error.  Do you need to specify a format 
>> string?  Is the ISO 'T' causing problems with a format that expects a 
>> space?  How have you defined the field?
>>
>> /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/a7015f02-3e03-407e-be45-cf05320e2012n%40googlegroups.com.


[web2py] Re: Upgraded to 2.19 and SQL Server date insert throws an error

2023-01-12 Thread Davidiam
Just for clarity on this issue: if you save your sessions to MSSQL you will 
get an error because the MS SQL driver is expecting the timestamp to be a 
string, but instead it is a datetime object due to the ".isoformat()" added 
in version 2.19.

By modifying the line 1247 in globals.py, putting the .isoformat in 
comment, the timestamp is again a string and it works again.


On Wednesday, January 11, 2023 at 12:08:54 PM UTC+1 Davidiam wrote:

> Hi,
>
> Has anyone found a solution for this?  We are experiencing the same issue 
> with 2.22.5 and storing the session in the db. 
> As a work-around, we have removed the ".isoformat" from the line 1247 of 
> the gluon\globals.py:
>
> modified_datetime=request.now, #.isoformat(),
>
> What would be the impact of our work-around?  If we put isoformat in 
> comment, the modified_datetime will be a string instead of a datetime 
> object.
>
> On Thursday, June 4, 2020 at 6:30:30 AM UTC+2 Seth J wrote:
>
>> Thanks for pointing the function.  But it looks like the error is 
>> happening on the Session insert. See below *query* block:
>>
>>
>>
>>- Variables
>>e DataError('22007', '[22007] [Microsoft][ODBC SQL...e from character 
>>string. (241) (SQLExecDirectW)')
>>
>> Context
>>
>> locals request session response
>> locals
>> e : DataError('22007', '[22007] [Microsoft][ODBC SQL...e from character 
>> string. (241) (SQLExecDirectW)')
>> fields : [(, '172.20.252.61'), 
>> (, 0), (, 
>> '2020-06-04T00:21:23.665000'), (, 
>> '5258b356-2b72-4a24-8868-710222ac0784'), (, 
>> datetime.datetime(2020, 6, 4, 0, 21, 23, 665000)), (> object>, 
>> '\x80\x02cgluon.globals\nSession\nq\x01}q\x02U\x05flashq\x03U\x00s\x85Rq\x04.')]
>> query : 'INSERT INTO 
>> "web2py_session_PubView"("client_ip"...FscwpTZXNzaW9uCnEBfXECVQVmbGFzaHEDVQBzhVJxBC4=\');'
>> self : 
>> table :
>> > unique_key, session_data)>
>>
>> On Wednesday, June 3, 2020 at 11:09:28 PM UTC-4, Dave S wrote:
>>>
>>>
>>>
>>> On Wednesday, June 3, 2020 at 2:04:02 PM UTC-7, Seth J wrote:
>>>>
>>>> I am not sure how to view the query sent to MSSQL.  
>>>>
>>>
>>> Does this help/?
>>> >> https://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#_lastsql
>>> >
>>>
>>>
>>>  
>>>
>>>> Here's a little more from the error record:
>>>>
>>>>
>>>>- 
>>>>
>>>>*File C:\inetpub\wwwroot\gluon\packages\dal\pydal\adapters\base.py 
>>>>in insert at line 539* code arguments variables
>>>>Function argument list
>>>>
>>>>(self=, table=>>>web2py_session_PubView (id, locked, clien...me, modified_datetime, 
>>>>unique_key, session_data)>, fields=[(, 
>>>>'172.20.145.208'), (, 0), 
>>>> (>>>object>, '2020-06-03T00:26:05.296000'), (, 
>>>>'affc9c47-0085-45dc-8352-12549c7f93dc'), (, 
>>>>datetime.datetime(2020, 6, 3, 0, 26, 5, 296000)), (>>>object>, 
>>>>
>>>> '\x80\x02cgluon.globals\nSession\nq\x01}q\x02U\x05flashq\x03U\x00s\x85Rq\x04.')])
>>>>
>>>>
>>> You've got a date conversion error.  Do you need to specify a format 
>>> string?  Is the ISO 'T' causing problems with a format that expects a 
>>> space?  How have you defined the field?
>>>
>>> /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/d0e07c9d-2cde-4b34-81a3-3e4160f4cf78n%40googlegroups.com.


[web2py] Re: web2py 2.23.0 is giving a 403 error when I try to package my applications

2023-01-09 Thread Davidiam
I just did a test on my own PC with web2py out of the box and I got a 403 
error when packing the application.  Now that I know that it has nothing to 
do with the webserver, I will try to debug the issue.
I will debug the issue to determine where in the code it is occurring.

On Thursday, January 5, 2023 at 9:54:07 AM UTC+1 Davidiam wrote:

> Good Morning,
>
> We are using IIS 10 with web2py 2.23.0.
>
> When I try to pack the welcome application (or any other), using pack_all 
> I get a 403 error.
> When I try to pack the welcome application (or any other), using 
> pack_custom, it first displays the file selector and when I click on 
> download as .w2p I get a 403 error.
>
> This seems to be related to the open_redirect changes.  I tried putting 
> the 403 error related code from the admin\default.py controller in comment, 
> but it still is giving the error.  
>
> Kind Regards,
> David
>

-- 
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/bfc9c2ff-9ef0-44d5-9343-b3634015c671n%40googlegroups.com.


[web2py] Re: web2py 2.23.0 is giving a 403 error when I try to package my applications

2023-01-09 Thread Davidiam
I found where this is occurring (out of the box run, no mods):

C:\Users\u30591\web2py_2.23.0\web2py\applications\admin\controllers\default.py:
def safe_open(a, b):
if (DEMO_MODE or is_gae) and ('w' in b or 'a' in b):
class tmp:

def write(self, data):
pass

def close(self):
pass
return tmp()

a_for_check = os.path.abspath(os.path.normpath(a))
web2py_apps_root = os.path.abspath(up(request.folder))

*if not a_for_check.startswith(web2py_apps_root):*
*raise HTTP(403) *

Because:
*web2py_apps_root* = 
'C:\\Users\\myuser\\web2py_2.23.0\\web2py\\applications'
*a_for_check *=  
'C:\\Users\\myuser\\web2py_2.23.0\\web2py\\deposit\\web2py.app.403_test.w2p'


On Thursday, January 5, 2023 at 9:54:07 AM UTC+1 Davidiam wrote:

> Good Morning,
>
> We are using IIS 10 with web2py 2.23.0.
>
> When I try to pack the welcome application (or any other), using pack_all 
> I get a 403 error.
> When I try to pack the welcome application (or any other), using 
> pack_custom, it first displays the file selector and when I click on 
> download as .w2p I get a 403 error.
>
> This seems to be related to the open_redirect changes.  I tried putting 
> the 403 error related code from the admin\default.py controller in comment, 
> but it still is giving the error.  
>
> Kind Regards,
> David
>

-- 
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/9234f487-62f0-4308-a2b1-b55a2774d729n%40googlegroups.com.


[web2py] Re: web2py 2.23.0 is giving a 403 error when I try to package my applications

2023-01-09 Thread Davidiam
Which is in turn caused by:

*def app_pack*(app, request, raise_ex=False, filenames=None):
"""Builds a w2p package for the application

Args:
app(str): application name
request: the global request object
Returns:
filename of the w2p file or None on error

"""
try:
if filenames is None:
app_cleanup(app, request)
*filename = apath('../deposit/web2py.app.%s.w2p' % app, request)*
w2p_pack(filename, apath(app, request), filenames=filenames)
return filename
except Exception as e:
if raise_ex:
raise
return False

On Monday, January 9, 2023 at 10:37:57 AM UTC+1 Davidiam wrote:

> I found where this is occurring (out of the box run, no mods):
>
>
> C:\Users\u30591\web2py_2.23.0\web2py\applications\admin\controllers\default.py:
> def safe_open(a, b):
> if (DEMO_MODE or is_gae) and ('w' in b or 'a' in b):
> class tmp:
>
> def write(self, data):
> pass
>
> def close(self):
> pass
> return tmp()
>
> a_for_check = os.path.abspath(os.path.normpath(a))
> web2py_apps_root = os.path.abspath(up(request.folder))
>
> *if not a_for_check.startswith(web2py_apps_root):*
> *raise HTTP(403) *
>
> Because:
> *web2py_apps_root* = 
> 'C:\\Users\\myuser\\web2py_2.23.0\\web2py\\applications'
> *a_for_check *=  
> 'C:\\Users\\myuser\\web2py_2.23.0\\web2py\\deposit\\web2py.app.403_test.w2p'
>
>
> On Thursday, January 5, 2023 at 9:54:07 AM UTC+1 Davidiam wrote:
>
>> Good Morning,
>>
>> We are using IIS 10 with web2py 2.23.0.
>>
>> When I try to pack the welcome application (or any other), using pack_all 
>> I get a 403 error.
>> When I try to pack the welcome application (or any other), using 
>> pack_custom, it first displays the file selector and when I click on 
>> download as .w2p I get a 403 error.
>>
>> This seems to be related to the open_redirect changes.  I tried putting 
>> the 403 error related code from the admin\default.py controller in comment, 
>> but it still is giving the error.  
>>
>> Kind Regards,
>> David
>>
>

-- 
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/6772c522-e442-4ff6-ac64-eda50f2ccce2n%40googlegroups.com.


[web2py] Re: web2py 2.23.0 is giving a 403 error when I try to package my applications

2023-01-09 Thread Davidiam
I am using python 3.9.15

On Monday, January 9, 2023 at 11:00:22 AM UTC+1 Clemens wrote:

> Just a guess: What python version are you using? If you're still using 
> python 2, it could be the reason.
>
> On Monday, January 9, 2023 at 10:55:21 AM UTC+1 david@gmail.com wrote:
>
>> Which is in turn caused by:
>>
>> *def app_pack*(app, request, raise_ex=False, filenames=None):
>> """Builds a w2p package for the application
>>
>> Args:
>> app(str): application name
>> request: the global request object
>> Returns:
>> filename of the w2p file or None on error
>>
>> """
>> try:
>> if filenames is None:
>> app_cleanup(app, request)
>> *filename = apath('../deposit/web2py.app.%s.w2p' % app, request)*
>> w2p_pack(filename, apath(app, request), filenames=filenames)
>> return filename
>> except Exception as e:
>> if raise_ex:
>> raise
>> return False
>>
>> On Monday, January 9, 2023 at 10:37:57 AM UTC+1 Davidiam wrote:
>>
>>> I found where this is occurring (out of the box run, no mods):
>>>
>>>
>>> C:\Users\u30591\web2py_2.23.0\web2py\applications\admin\controllers\default.py:
>>> def safe_open(a, b):
>>> if (DEMO_MODE or is_gae) and ('w' in b or 'a' in b):
>>> class tmp:
>>>
>>> def write(self, data):
>>> pass
>>>
>>> def close(self):
>>> pass
>>> return tmp()
>>>
>>> a_for_check = os.path.abspath(os.path.normpath(a))
>>> web2py_apps_root = os.path.abspath(up(request.folder))
>>>
>>> *if not a_for_check.startswith(web2py_apps_root):*
>>> *raise HTTP(403) *
>>>
>>> Because:
>>> *web2py_apps_root* = 
>>> 'C:\\Users\\myuser\\web2py_2.23.0\\web2py\\applications'
>>> *a_for_check *=  
>>> 'C:\\Users\\myuser\\web2py_2.23.0\\web2py\\deposit\\web2py.app.403_test.w2p'
>>>
>>>
>>> On Thursday, January 5, 2023 at 9:54:07 AM UTC+1 Davidiam wrote:
>>>
>>>> Good Morning,
>>>>
>>>> We are using IIS 10 with web2py 2.23.0.
>>>>
>>>> When I try to pack the welcome application (or any other), using 
>>>> pack_all I get a 403 error.
>>>> When I try to pack the welcome application (or any other), using 
>>>> pack_custom, it first displays the file selector and when I click on 
>>>> download as .w2p I get a 403 error.
>>>>
>>>> This seems to be related to the open_redirect changes.  I tried putting 
>>>> the 403 error related code from the admin\default.py controller in 
>>>> comment, 
>>>> but it still is giving the error.  
>>>>
>>>> Kind Regards,
>>>> David
>>>>
>>>

-- 
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/0556e16d-3e6d-4879-b2e3-e4781006c4e9n%40googlegroups.com.


[web2py] Latest version of web2py and python versions

2022-12-20 Thread Davidiam
Good morning,

Can anyone tell me if the latest version of web2py was specifically 
developed for any specific python version or range of python versions?

After years of using an older version, and being limited to the version 
3.6, we will be upgrading to the most recent version of web2py, and I will 
need to recommend a version of python to the different development groups.

python 3.7 will be out of support soon, so I would ideally like to move to 
python 3.9 or 3.10.  I did a test with 3.9 yesterday and all my 
applications worked fine, but I just wanted to be sure that the version was 
meant to be used with these higher versions.

Kind Regards,
David

-- 
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/9f000931-42f2-4eec-9a3a-47667307e636n%40googlegroups.com.


[web2py] Re: Visual Studio Code

2022-12-21 Thread Davidiam
I tried the  https://github.com/Andyhasit/web2py_intellisense in VS Code, 
but couldn't get it to work.  
I am sure that I set it up wrong as I didn't quite understand the 
instructions in the readme file.

1) I copied  *auto_completion_support.py* into the modules folder of my 
welcome application.
2) I created a zzz.py in the models folder and added the following code:
if 0: 
import autocomplete_fakes.py 
# from ide_code_completion import *
file = "c:\\temp\\dummy.py"
*generate_auto_completion_file(db, file)*

I tried running it but it wouldn't load the models.
On Friday, May 1, 2020 at 11:55:39 AM UTC+2 villas wrote:

> Further to Andrew's reply you could also try these ideas:
>
>
> http://www.web2py.com/books/default/chapter/29/14/other-recipes?search=ide+#Using-general-purpose-IDEs-with-web2py
>
> https://github.com/Andyhasit/web2py_intellisense
>

-- 
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/174b03d0-2e2b-4880-b7bd-63e25b49fa32n%40googlegroups.com.


Re: [web2py] Active directory authentication

2023-02-05 Thread Davidiam
We do AD authentication with Shibboleth as our service provider on IIS 10.  I 
don't know if that would be an option.  We couldn't find anything else that 
worked on Windows.

Sent from Outlook for Android

From: web2py@googlegroups.com  on behalf of Silvian 
“Top 10 Answers” Cedru 
Sent: Monday, February 6, 2023 4:25:40 AM
To: web2py-users 
Subject: Re: [web2py] Active directory authentication

Did you figure it out in the end cause I am facing the same issue right now :)

urban@gmail.com schrieb am Donnerstag, 3. März 2022 um 21:31:25 UTC+7:
"Still trying to wade through the seemingly half outdated guides"
I'm referring to Azure guides not Web2Py.

On Thursday, March 3, 2022 at 2:10:33 PM UTC+1 urban@gmail.com wrote:
No it's not on-premise. They said so explicitly. Apologise for the low info 
questions. Still trying to wade through the seemingly half outdated guides. 
Finally got the Flask demo that MS provides to work so that I know the Azure 
side of things is working at least. Now have to figure out how to implement it 
in Web2Py. Is the ldap_auth method only for on premise AD?

On Wednesday, March 2, 2022 at 7:24:58 PM UTC+1 nico...@gmail.com wrote:
Hi,

do you really use Azure AD? Otherwise, for normal on-premise AD, see the 
documentation on 
http://web2py.com/books/default/chapter/29/09/access-control#LDAP and 
https://github.com/web2py/web2py/blob/master/gluon/contrib/login_methods/ldap_auth.py

Nico


Il giorno mer 2 mar 2022 alle ore 16:48 urban@gmail.com 
 ha scritto:
We're looking into adding AD authentication to our app. We have an active 
directory account and an app registered on it.

In the documentation I found this example of enabling AD auth:

from gluon.contrib.login_methods.ldap_auth import ldap_auth  
auth.settings.login_methods.append(
  ldap_auth(
   mode='ad',
   server='https://aad.portal.azure.com/',
   base_dn='ou=Users,dc=domain,dc=com'
  )
)

However I get this error when trying to login

DEBUG:web2py.auth.ldap_auth:Traceback (most recent call last):
  File 
"C:\urban\web2py_latest\web2py\gluon\contrib\login_methods\ldap_auth.py", line 
236, in ldap_auth_aux
con = init_ldap()
  File 
"C:\urban\web2py_latest\web2py\gluon\contrib\login_methods\ldap_auth.py", line 
630, in init_ldap
"ldap://; + ldap_server + ":" + str(ldap_port))
  File "C:\Python27\lib\site-packages\ldap\functions.py", line 92, in initialize
uri, trace_level, trace_file, trace_stack_limit, bytes_mode, **kwargs)
  File "C:\Python27\lib\site-packages\ldap\ldapobject.py", line 106, in __init__
self._l = 
ldap.functions._ldap_function_call(ldap._ldap_module_lock,_ldap.initialize,uri)
  File "C:\Python27\lib\site-packages\ldap\functions.py", line 55, in 
_ldap_function_call
result = func(*args,**kwargs)
LDAPError: (0, 'Error')

Am I doing anything wrong on the web2py side or is the issue in the AD 
configuration?

--
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+un...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/7d013980-154b-4b94-9365-4a64f9e32423n%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/a406d846-fdc8-4e71-aa0c-4efb8b4f1c5an%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/AM8P193MB080284160269AAD0298C954CFEDA9%40AM8P193MB0802.EURP193.PROD.OUTLOOK.COM.


[web2py] Re: web2py 2.23.0 is giving a 403 error when I try to package my applications

2023-02-12 Thread Davidiam
Hi pcg,

I also created a bug report for this one and got a message from Massimo 
that it would be fixed in a new release.  A work-around I used was to 
simply put the code below in the admin default.py into comment:
*#if not a_for_check.startswith(web2py_apps_root):*
*#raise HTTP(403) *
But I don't know what the final solution will be in the official fix.

Kind Regards,
David

On Sunday, February 12, 2023 at 10:21:20 PM UTC+1 pcg...@gmail.com wrote:

> Have the same issue (python 3.10)  i've tried the latest web2py 2.23.1, 
> and it's th same.   I'm kind of lost on this one.
>
> Le lundi 9 janvier 2023 à 05:44:16 UTC-5, david@gmail.com a écrit :
>
>> I am using python 3.9.15
>>
>> On Monday, January 9, 2023 at 11:00:22 AM UTC+1 Clemens wrote:
>>
>>> Just a guess: What python version are you using? If you're still using 
>>> python 2, it could be the reason.
>>>
>>> On Monday, January 9, 2023 at 10:55:21 AM UTC+1 david@gmail.com 
>>> wrote:
>>>
>>>> Which is in turn caused by:
>>>>
>>>> *def app_pack*(app, request, raise_ex=False, filenames=None):
>>>> """Builds a w2p package for the application
>>>>
>>>> Args:
>>>> app(str): application name
>>>> request: the global request object
>>>> Returns:
>>>> filename of the w2p file or None on error
>>>>
>>>> """
>>>> try:
>>>> if filenames is None:
>>>> app_cleanup(app, request)
>>>> *filename = apath('../deposit/web2py.app.%s.w2p' % app, 
>>>> request)*
>>>> w2p_pack(filename, apath(app, request), filenames=filenames)
>>>> return filename
>>>> except Exception as e:
>>>> if raise_ex:
>>>> raise
>>>> return False
>>>>
>>>> On Monday, January 9, 2023 at 10:37:57 AM UTC+1 Davidiam wrote:
>>>>
>>>>> I found where this is occurring (out of the box run, no mods):
>>>>>
>>>>>
>>>>> C:\Users\u30591\web2py_2.23.0\web2py\applications\admin\controllers\default.py:
>>>>> def safe_open(a, b):
>>>>> if (DEMO_MODE or is_gae) and ('w' in b or 'a' in b):
>>>>> class tmp:
>>>>>
>>>>> def write(self, data):
>>>>> pass
>>>>>
>>>>> def close(self):
>>>>> pass
>>>>> return tmp()
>>>>>
>>>>> a_for_check = os.path.abspath(os.path.normpath(a))
>>>>> web2py_apps_root = os.path.abspath(up(request.folder))
>>>>>
>>>>> *if not a_for_check.startswith(web2py_apps_root):*
>>>>> *raise HTTP(403) *
>>>>>
>>>>> Because:
>>>>> *web2py_apps_root* = 
>>>>> 'C:\\Users\\myuser\\web2py_2.23.0\\web2py\\applications'
>>>>> *a_for_check *=  
>>>>> 'C:\\Users\\myuser\\web2py_2.23.0\\web2py\\deposit\\web2py.app.403_test.w2p'
>>>>>
>>>>>
>>>>> On Thursday, January 5, 2023 at 9:54:07 AM UTC+1 Davidiam wrote:
>>>>>
>>>>>> Good Morning,
>>>>>>
>>>>>> We are using IIS 10 with web2py 2.23.0.
>>>>>>
>>>>>> When I try to pack the welcome application (or any other), using 
>>>>>> pack_all I get a 403 error.
>>>>>> When I try to pack the welcome application (or any other), using 
>>>>>> pack_custom, it first displays the file selector and when I click on 
>>>>>> download as .w2p I get a 403 error.
>>>>>>
>>>>>> This seems to be related to the open_redirect changes.  I tried 
>>>>>> putting the 403 error related code from the admin\default.py controller 
>>>>>> in 
>>>>>> comment, but it still is giving the error.  
>>>>>>
>>>>>> Kind Regards,
>>>>>> David
>>>>>>
>>>>>

-- 
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/821a80ba-4903-49eb-97cb-d8bf5631c32an%40googlegroups.com.


[web2py] Does anyone know why exceptions are not always passed up the call stack when running a script from the web2py shell?

2023-05-25 Thread Davidiam
2.22.5-stable+timestamp.2022.06.04.18.13.51
(Running on Microsoft-IIS/10.0, Python 3.9.13)

I am trying to catch errors in web2py shell scripts which are run in batch, 
but some exceptions are not being passed up the call stack when running in 
shell mode.

My situation is as follows:

   1. Create the error scenario
  1. empty the languages/plural-en.py in the welcome application
   2. Run a shell script using -M -R 
  1. can be a simple Hello World script
   3. Since it is a shell script, shell.py is used instead of main.py
   4. The exception will be triggered in gluon/languages.py in in the 
   function read_plural_dict_aux() when executing 
  1. return eval(lang_text) or {}
   5. In this scenario, the shell script will fail but give a success 
   return code (rc=0) because the exception is not passed up the call stack
   6. If the welcome application is run via the browser, it uses main.py 
   instead of shell.py and the exception is passed up the call stack and we 
   can see the error code in the error ticket.  

I have tried catching the exception from a few different places and tried 
custom extensions as well, but I can't catch this exception anywhere in the 
call stack.

The reason I am trying to solve this is that we have batch jobs that 
sometimes have failed but give a success return code and so I am trying to 
find the root cause.  I think that this failure to capture the exceptions 
may be the cause.  Does anyone have any ideas as to what could be the 
reason for this? 

Note: If you want to see the call stack, it suffices to delete all the 
contents of plural-en.py and run the welcome app from the browser.  In the 
error ticket, the call stack will basically the same as the shell version 
as of the call to compileapp.py

Kind Regards,
David

-- 
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/a3de01b6-336a-44bd-ab79-ec47af07f382n%40googlegroups.com.


[web2py] add record no longer available in smartgrid since switch to ms sql

2024-01-18 Thread Davidiam
I recently switched from sqlite to MS SQL and my application no longer 
allows me to add new records using the smartgrad.  I have editable and 
deletable set to True but I can only view the records.

If I use a basic SQLFORM I can add records, but I would prefer using the 
smartgrid.
Is there a trick to getting it working with MS SQL?

This only allows me to view the record:
grid = SQLFORM.smartgrid(db.image, create=True, editable=True, 
deletable=True, linked_tables=['post'])
return dict(grid=grid)

With this is I can add new records:
record = db.image(request.args(0))  # Tries to get  an existing record 
where the id is specified in the first argument if the url.

image_form = SQLFORM(db.image, record)  # Creates a form based on the 
'image' table. If a record was found, it will show the record details 

if image_form.process().accepted:  # When the form is submitted (not 
when it is created) it will try and process it and add the record or save 
any changes to the record.
response.flash = 'form accepted' 
elif image_form.errors:
response.flash = 'form has errors'
return dict(grid=image_form)

Kind Regards,
David

-- 
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/0c50ff77-0a87-4617-b69c-b157763c7bcfn%40googlegroups.com.


[web2py] Re: add record no longer available in smartgrid since switch to ms sql

2024-01-18 Thread Davidiam
I found the reason.  I needed to add  user_signature=False

The default for this parameter is True and will prevent you from adding 
records!!!
On Thursday, January 18, 2024 at 1:47:37 PM UTC+1 Davidiam wrote:

> I recently switched from sqlite to MS SQL and my application no longer 
> allows me to add new records using the smartgrad.  I have editable and 
> deletable set to True but I can only view the records.
>
> If I use a basic SQLFORM I can add records, but I would prefer using the 
> smartgrid.
> Is there a trick to getting it working with MS SQL?
>
> This only allows me to view the record:
> grid = SQLFORM.smartgrid(db.image, create=True, editable=True, 
> deletable=True, linked_tables=['post'])
> return dict(grid=grid)
>
> With this is I can add new records:
> record = db.image(request.args(0))  # Tries to get  an existing record 
> where the id is specified in the first argument if the url.
> 
> image_form = SQLFORM(db.image, record)  # Creates a form based on the 
> 'image' table. If a record was found, it will show the record details 
> 
> if image_form.process().accepted:  # When the form is submitted (not 
> when it is created) it will try and process it and add the record or save 
> any changes to the record.
> response.flash = 'form accepted' 
> elif image_form.errors:
> response.flash = 'form has errors'
> return dict(grid=image_form)
>
> Kind Regards,
> David
>

-- 
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/74fe3183-a0ef-4cc7-9690-3a870be6ef73n%40googlegroups.com.