[web2py] Re: python3 + web2py + Lighttpd + fastcgi

2020-03-21 Thread patito feo
Thank you Massimo.

As a result the code now shows more "L" cases, i just removed them. But now 
it presents incompatibilities with exceptions and raises.

  File , line 618
def _end(self, appStatus=0L, protocolStatus=FCGI_REQUEST_COMPLETE):
  ^
SyntaxError: invalid syntax

  File , line 1080
except select.error, e:
   ^
SyntaxError: invalid syntax


  File , line 1134
raise NotImplementedError, self.__class__.__name__ + '.handler'
 ^
SyntaxError: invalid syntax


  File , line 1317
name, cgi.escape(`environ[name]`))
 ^
SyntaxError: invalid syntax


As i told you before the "L" cases i fixed them, but this others errors 
dont know how to fixed them.


Thanks for your help.



El s谩bado, 21 de marzo de 2020, 20:26:06 (UTC-5), Massimo Di Pierro 
escribi贸:
>
> Fixed right now on github. Python 3 does not like the L
>
> On Saturday, 21 March 2020 16:11:38 UTC-7, patito feo wrote:
>>
>> Hi all,
>>
>> I've been trying to run web2py using python3 but unable to do it 
>> sucessful.
>> Using latest build 2.19.1
>>
>> I keep getting this error:
>>
>>  Traceback (most recent call last):
>>   File "/folder/folder/folder/fcgihandler.py", line 44, in 
>> import gluon.contrib.gateways.fcgi as fcgi
>>   File "/folder/folder/folder/gluon/contrib/gateways/fcgi.py", line 439
>> s = struct.pack('!L', nameLength | 0x8000L)
>>  ^
>> SyntaxError: invalid syntax
>>
>> Please help me find a solution or a replacement.
>>
>>
>> Cheers,
>>
>

-- 
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/db890a84-1cb3-464b-bec9-d97521e87358%40googlegroups.com.


Re: [web2py] web2py 2.19.1 is OUT

2020-03-21 Thread Lovedie JC
I've updated it.
Flawless
馃憤
Good work. Much appreciated.
Regards

On Sun, Mar 22, 2020, 04:28 Christian Varas  wrote:

> Thanks! 馃帀馃帀馃帀馃帄
>
> El El s谩b, 21 de mar. de 2020 a la(s) 18:52, Massimo Di Pierro <
> massimo.dipie...@gmail.com> escribi贸:
>
>> Sorry it took so long.
>>
>> Web2py 2.19.1 is finally out.
>>
>> It contains many small bug fixes including better support for python 3.6,
>> 3.7, and 3.8
>>
>> https://travis-ci.org/github/web2py/web2py
>>
>> --
>> 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/c432d75b-bfdc-414c-b110-f6e7bfc0265d%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/CA%2Bs%2BuJsMSc4GhYHR9VpsJycKAdCzSr8vQK30WwBPmJOLQg2BLA%40mail.gmail.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/CAAcHJF8dZTRrYnLmfVwmq_gZe6Gz3w%2BiqXRxT1h2qdE7X_6Dgg%40mail.gmail.com.


Re: [web2py] web2py 2.19.1 is OUT

2020-03-21 Thread Christian Varas
Thanks! 馃帀馃帀馃帀馃帄

El El s谩b, 21 de mar. de 2020 a la(s) 18:52, Massimo Di Pierro <
massimo.dipie...@gmail.com> escribi贸:

> Sorry it took so long.
>
> Web2py 2.19.1 is finally out.
>
> It contains many small bug fixes including better support for python 3.6,
> 3.7, and 3.8
>
> https://travis-ci.org/github/web2py/web2py
>
> --
> 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/c432d75b-bfdc-414c-b110-f6e7bfc0265d%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/CA%2Bs%2BuJsMSc4GhYHR9VpsJycKAdCzSr8vQK30WwBPmJOLQg2BLA%40mail.gmail.com.


Re: [web2py] web2py 2.19.1 is OUT

2020-03-21 Thread Massimo Di Pierro
Let me know when ready. 

On Saturday, 21 March 2020 16:12:13 UTC-7, Nico Zanferrari wrote:
>
> Thanks Massimo!
>
> Please note that the binaries listed on 
> http://www.web2py.com/init/default/download are supposed to be the new 
> ones with Pyinstaller, but in fact they are the old broken ones.
> I'm working for buiding the new binaries - you cannot just replace the 
> sources inside because the main web2py.py program has been changed.
>
> Nico
>
> Il giorno sab 21 mar 2020 alle ore 22:52 Massimo Di Pierro <
> massimo.dipie...@gmail.com> ha scritto:
>
>> Sorry it took so long.
>>
>> Web2py 2.19.1 is finally out.
>>
>> It contains many small bug fixes including better support for python 3.6, 
>> 3.7, and 3.8
>>
>> https://travis-ci.org/github/web2py/web2py
>>
>> -- 
>> 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/c432d75b-bfdc-414c-b110-f6e7bfc0265d%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/d67e1263-62b6-4ff1-90de-aa41b10a81b0%40googlegroups.com.


[web2py] Re: python3 + web2py + Lighttpd + fastcgi

2020-03-21 Thread Massimo Di Pierro
Fixed right now on github. Python 3 does not like the L

On Saturday, 21 March 2020 16:11:38 UTC-7, patito feo wrote:
>
> Hi all,
>
> I've been trying to run web2py using python3 but unable to do it sucessful.
> Using latest build 2.19.1
>
> I keep getting this error:
>
>  Traceback (most recent call last):
>   File "/folder/folder/folder/fcgihandler.py", line 44, in 
> import gluon.contrib.gateways.fcgi as fcgi
>   File "/folder/folder/folder/gluon/contrib/gateways/fcgi.py", line 439
> s = struct.pack('!L', nameLength | 0x8000L)
>  ^
> SyntaxError: invalid syntax
>
> Please help me find a solution or a replacement.
>
>
> Cheers,
>

-- 
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/770bab28-dd87-46f9-ac17-171a72d89cee%40googlegroups.com.


Re: [web2py] web2py 2.19.1 is OUT

2020-03-21 Thread Nico Zanferrari
Thanks Massimo!

Please note that the binaries listed on
http://www.web2py.com/init/default/download are supposed to be the new ones
with Pyinstaller, but in fact they are the old broken ones.
I'm working for buiding the new binaries - you cannot just replace the
sources inside because the main web2py.py program has been changed.

Nico

Il giorno sab 21 mar 2020 alle ore 22:52 Massimo Di Pierro <
massimo.dipie...@gmail.com> ha scritto:

> Sorry it took so long.
>
> Web2py 2.19.1 is finally out.
>
> It contains many small bug fixes including better support for python 3.6,
> 3.7, and 3.8
>
> https://travis-ci.org/github/web2py/web2py
>
> --
> 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/c432d75b-bfdc-414c-b110-f6e7bfc0265d%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/CAAE8D_AygPCkK04kWqM9--VhZtaoYQ%2BkMyjmKBx4fUz_nRcQ2A%40mail.gmail.com.


[web2py] python3 + web2py + Lighttpd + fastcgi

2020-03-21 Thread patito feo
Hi all,

I've been trying to run web2py using python3 but unable to do it sucessful.
Using latest build 2.19.1

I keep getting this error:

 Traceback (most recent call last):
  File "/folder/folder/folder/fcgihandler.py", line 44, in 
import gluon.contrib.gateways.fcgi as fcgi
  File "/folder/folder/folder/gluon/contrib/gateways/fcgi.py", line 439
s = struct.pack('!L', nameLength | 0x8000L)
 ^
SyntaxError: invalid syntax

Please help me find a solution or a replacement.


Cheers,

-- 
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/7904b215-79c4-4720-8a2e-d2b93501abf9%40googlegroups.com.


[web2py] web2py 2.19.1 is OUT

2020-03-21 Thread Massimo Di Pierro
Sorry it took so long.

Web2py 2.19.1 is finally out.

It contains many small bug fixes including better support for python 3.6, 
3.7, and 3.8

https://travis-ci.org/github/web2py/web2py

-- 
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/c432d75b-bfdc-414c-b110-f6e7bfc0265d%40googlegroups.com.


[web2py] Re: web2py with python 2.7 and web2py running on python 3

2020-03-21 Thread Andrea Fae'
I have a windows 10 PC.
I installed c:\python27 and c:\python3 and they are working. I can choose.

But if I try to start web2py it happens this error:

c:\Python3>python.exe c:\web2py\web2py.py
Traceback (most recent call last):
  File "c:\web2py\web2py.py", line 21, in 
import gluon.widget
  File "c:\web2py\gluon\__init__.py", line 37, in 
from .globals import current
  File "c:\web2py\gluon\globals.py", line 24, in 
from gluon.serializers import json, custom_json
  File "c:\web2py\gluon\serializers.py", line 10, in 
from gluon.languages import lazyT
  File "c:\web2py\gluon\languages.py", line 19, in 
from cgi import escape
ImportError: cannot import name 'escape' from 'cgi' (c:\Python3\lib\cgi.py)

I found that changing "from cgi import escape" to "from html import escape" 
it start but I don't knoy why.

Nevertheless If I try to start an app built from Python27 I have this error:

 Failure to connect, tried 5 times: 
Traceback (most recent call last): File 
"C:\web2py\gluon\packages\dal\pydal\base.py", line 454, in __init__ 
self._adapter = adapter(**kwargs) File 
"C:\web2py\gluon\packages\dal\pydal\adapters\__init__.py", line 40, in 
__call__ obj = super(AdapterMeta, cls).__call__(*args, **kwargs) File 
"C:\web2py\gluon\packages\dal\pydal\adapters\base.py", line 368, in 
__init__ super(SQLAdapter, self).__init__(*args, **kwargs) File 
"C:\web2py\gluon\packages\dal\pydal\adapters\base.py", line 52, in __init__ 
self.reconnect() File "C:\web2py\gluon\packages\dal\pydal\connection.py", 
line 172, in reconnect self.connection = self.connector() File 
"C:\web2py\gluon\packages\dal\pydal\adapters\mysql.py", line 52, in 
connector return self.driver.connect(**self.driver_args) File 
"C:\web2py\gluon\contrib\pymysql\__init__.py", line 90, in Connect return 
Connection(*args, **kwargs) File 
"C:\web2py\gluon\contrib\pymysql\connections.py", line 688, in __init__ 
self.connect() File "C:\web2py\gluon\contrib\pymysql\connections.py", line 
905, in connect self._get_server_information() File 
"C:\web2py\gluon\contrib\pymysql\connections.py", line 1231, in 
_get_server_information self.server_charset = charset_by_id(lang).name File 
"C:\web2py\gluon\contrib\pymysql\charset.py", line 38, in by_id return 
self._by_id[id] KeyError: 255

If I start the same app with web2py on python 2.7 changing back to "from 
cgi import escape" and it's working.
Maybe this is a problem regarding foreign-keys, I had one time in the past 
but really... I don't remember how to fix.

Thank you

Il giorno venerd矛 20 marzo 2020 22:05:59 UTC+1, Jonathan Clark ha scritto:
>
> Definitely if you're using the rocket web server. There are various ways 
> to run different versions of python on the same machine but it depends on 
> your OS how to do it. Once you can run different pythons, you can run 
> different versions of web2py at the same time, but you will need to use 
> different ports e.g. 8080, 8081 etc. to direct the traffic to the right 
> web2py instance. That's without Apache.
>
> I also run different web2py instances behind the same Apache instance on a 
> virtual host, but I have set up Apache to forward virtual host one to one 
> port (using .htaccess), and virtual host two to a different port. The 
> rocket server in web2py in each instance is told which port it should 
> respond to. So the browser looks for www.hostone.com, .htaccess forwards 
> that to port number 65789, and a web2py instance is run to service requests 
> to port 65789. For hosttwo, the port number changes.
>
> Here is a snippet of a .htacces file which does what I want:
>
> RewriteCond %{HTTP_HOST}  hostone.com$
> RewriteRule ^(.*)$https://127.0.0.1:65789/$1 [P,QSA,L]
>
> (There is another redirect which directs www.hostone.com to hostone.com).
>
>
> On Saturday, 14 March 2020 19:06:20 UTC, Andrea Fae' wrote:
>>
>> Is it possible to have 2 differents environment on the same PC?
>> web2py running python2.7 and web2py running ppython 3 separated...?
>> Thank you 
>>
>

-- 
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/74c4d214-c657-4a99-b8a5-0582199f24c9%40googlegroups.com.


Re: [web2py] Re: Py4web readonly Form

2020-03-21 Thread villas
Hi John
What you say doesn't make much sense because you can style and view data 
however you wish, including in a readonly form.  Similarly a button can 
redirect your users to wherever you wish.  You don't need the framework 
forms for that.  Just style your page how you wish.



On Saturday, 21 March 2020 08:11:39 UTC, John Bannister wrote:
>
> Hi Massimo,
>
>  
>
> My use case is really to give the user the option to view data stored in a 
> table without the ability to change anything hence readonly. Once they have 
> finished viewing the form (normally by hitting the submit button) they will 
> be redirected to whatever.
>
>  
>
> Hope it makes sense
>
> John
>
>  
>
> *From:* web...@googlegroups.com  [mailto:
> web...@googlegroups.com ] *On Behalf Of *Massimo Di Pierro
> *Sent:* 21 March 2020 07:36
> *To:* web2py-users
> *Subject:* [web2py] Re: Py4web readonly Form
>
>  
>
> You may be right but what is the meaning of submitting and accepting a 
> readonly form? What is a use case?
>
>
> On Friday, 6 March 2020 00:53:17 UTC-8, John Bannister wrote:
>
> Hi All,
>
>  
>
> I have been testing Py4web and have the following to produce basically a 
> 'view record' option :-
>
>  
>
> def view_test():
>
> form=Form(db.auth_user, record=1, readonly=True, deletable=False, 
> formstyle=FormStyleBulma)
>
> if form.accepted:
>
> redirect(URL('index'))
>
> return dict(form=form)
>
>  
>
> This will redirect if I remove the readonly=True from the form but 
> basically form is just displayed (all fields are readonly) and you can hit 
> the submit button as many times as you like and nothing will happen.
>
>  
>
> Any ideas??
>
>  
>
> BR
>
> John
>
>  
>
> -- 
> 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/2089781a-8a2e-4b62-90d4-98a6183b375b%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/0805beda-5c1b-4733-8338-4bce43b9342d%40googlegroups.com.


[web2py] web2py LOAD on localhost vs pythonanywhere

2020-03-21 Thread Maurice Waka
I have this code on both local host and pythonanywhere test page.







{{if post.message:}}
{{=post.created_on}}

{{=post.message}}
{{else:}}
{{pass}}






{{if post.answer:}}
{{=post.created_on}}

{{=post.answer}}
{{else:}}
{{pass}}






{{pass}}



{{=form.custom.begin}}


{{=form.custom.widget.message}}


{{=form.custom.submit}}

{{=form.custom.end}}




scrollingElement = (document.scrollingElement || document.body)
function scrollToBottom () {
   scrollingElement.scrollTop = scrollingElement.scrollHeight;
}


function scrollToTop (id) {
   scrollingElement.scrollTop = 0;
}


//Require jQuery
function scrollSmoothToBottom (id) {
   $(scrollingElement).animate({
  scrollTop: document.body.scrollHeight
   }, 1500);
}





I notice that when the page loads, it looks OK on the local host as i'm 
able to see the last posted item on the screen.

When it comes to PA, the item is scrolled down and hidden from view, and I 
have to scroll the page again to see it.

See the attached images to illustrate.

Could it be that my code is erroneous ?

How can I correct it?

Kind regards

-- 
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/7f367351-938f-4cd6-ae0f-a7823e7dea0e%40googlegroups.com.


Re: [web2py] Re: tailwindcss with web2py ?

2020-03-21 Thread Ant贸nio Ramos
I麓m just looking into it but after the start barrier it seems that it
give more freedom of creation over bootstrap.
We just have to learn the utility classes 


https://blog.logrocket.com/tailwind-css-is-it-tomorrows-bootstrap-ebe560f9d00b/


https://dev.to/lauragift21/love-at-second-sight-with-tailwindcss-23dc


Em s谩b., 21 de mar. de 2020 脿s 07:08, Massimo Di Pierro <
massimo.dipie...@gmail.com> escreveu:

> The barrier of entry seems pretty high. What do you like about it?
>
> On Friday, 20 March 2020 04:37:23 UTC-7, Ramos wrote:
>>
>> any thoughts about tailwindcss ?
>>
>> Seems to me that could be the best option for web2py as it is very
>> programable as we all like :)
>>
>> just one nice thing i like...
>> https://tailwindcss.com/docs/extracting-components
>>
> --
> 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/0acd12fc-b296-453e-831c-41bd44951ce6%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/CAEM0BxNcniwK5eJavfkdqrM%3DydEOOOCdz-tUPqsmhfkfTNsPPg%40mail.gmail.com.


RE: [web2py] Re: Py4web readonly Form

2020-03-21 Thread John Bannister
Hi Massimo,

 

My use case is really to give the user the option to view data stored in a 
table without the ability to change anything hence readonly. Once they have 
finished viewing the form (normally by hitting the submit button) they will be 
redirected to whatever.

 

Hope it makes sense

John

 

From: web2py@googlegroups.com [mailto:web2py@googlegroups.com] On Behalf Of 
Massimo Di Pierro
Sent: 21 March 2020 07:36
To: web2py-users
Subject: [web2py] Re: Py4web readonly Form

 

You may be right but what is the meaning of submitting and accepting a readonly 
form? What is a use case?


On Friday, 6 March 2020 00:53:17 UTC-8, John Bannister wrote:

Hi All,

 

I have been testing Py4web and have the following to produce basically a 'view 
record' option :-

 

def view_test():

form=Form(db.auth_user, record=1, readonly=True, deletable=False, 
formstyle=FormStyleBulma)

if form.accepted:

redirect(URL('index'))

return dict(form=form)

 

This will redirect if I remove the readonly=True from the form but basically 
form is just displayed (all fields are readonly) and you can hit the submit 
button as many times as you like and nothing will happen.

 

Any ideas??

 

BR

John

 

-- 
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/2089781a-8a2e-4b62-90d4-98a6183b375b%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/033e01d5ff58%2453f3f700%24fbdbe500%24%40gmail.com.


[web2py] Re: error

2020-03-21 Thread Massimo Di Pierro
Sorry. need more info. What has coursera got to do with web2py?

On Friday, 20 March 2020 23:20:09 UTC-7, Rashdan Hadri wrote:
>
> I cant seem to log in when i get redirected from COursera python basics
>
>

-- 
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/c1c68af3-ce05-4c54-916d-f08932c97d33%40googlegroups.com.


[web2py] Re: tailwindcss with web2py ?

2020-03-21 Thread Massimo Di Pierro
The barrier of entry seems pretty high. What do you like about it?

On Friday, 20 March 2020 04:37:23 UTC-7, Ramos wrote:
>
> any thoughts about tailwindcss ?
>
> Seems to me that could be the best option for web2py as it is very 
> programable as we all like :)
>
> just one nice thing i like...
> https://tailwindcss.com/docs/extracting-components  
>

-- 
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/0acd12fc-b296-453e-831c-41bd44951ce6%40googlegroups.com.


[web2py] Re: web2py 2.18.5 breaks mysql connection

2020-03-21 Thread Massimo Di Pierro
This week-end.

On Tuesday, 17 March 2020 12:33:23 UTC-7, Donald McClymont wrote:
>
> Any update on when 2.18.6 will be released - or is there an accepted 
> workaround other than taking latest version?  This seems a rather 
> fundamental bug when you upgrade a mysql setup?
>
> Regards
> Donald
>
> On Friday, April 12, 2019 at 4:59:55 AM UTC+1, Massimo Di Pierro wrote:
>>
>> will release 2.18.6 asap. fixed in pydal master
>>
>> On Tuesday, 9 April 2019 17:43:43 UTC-7, var...@seas.upenn.edu wrote:
>>>
>>>
>>> Commit 59a9260c5d7b5677d207a90798c1058779dfe871 adds the following line 
>>> to gluon/packages/dal/pydal/adapters/mysql.py (line 44 in 2.18.5):
>>>
>>> self.driver_args['password'] = password
>>>
>>> This does not work with MySQLdb.py.  "TypeError: \'password\' is an 
>>> invalid keyword argument for this function\n'"  It needs to be
>>>
>>> self.driver_args['passwd'] = password
>>>
>>> Making this change in my copy of the source fixes the problem.  Could 
>>> you please fix this in web2py?
>>>
>>> Thanks
>>>
>>> Kris
>>>
>>

-- 
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/64d4f518-1576-4143-ac8f-769772d70a1d%40googlegroups.com.


[web2py] Re: Error (web2py on GAE): ImportError: No module named gluon.settings

2020-03-21 Thread Massimo Di Pierro
Maybe the file got deleted or corrupted or excluded fro deployment? It 
exists in web2py.

On Tuesday, 17 March 2020 12:21:43 UTC-7, PRACHI VAKHARIA wrote:
>
> *web2py on GAE* gives the following error:
>
>
> *ImportError: No module named gluon.settings 
> (/base/data/home/apps/s~appname/appversion.425325282173601763/gaehandler.py:47)*
>
> Everything was working fine.
> Can someone enlighten what is happening?
>

-- 
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/fbc7a6d2-ac1e-47ce-b80f-74bd120cee4c%40googlegroups.com.


[web2py] Re: MacOS Catalina, Apache SSL

2020-03-21 Thread Massimo Di Pierro
Do not use apache. You do not need it. f you need to serve from outside to 
osx, consider nginx.

On Tuesday, 17 March 2020 08:42:48 UTC-7, Karl McHugh wrote:
>
> I'm having trouble setting up web2py with the following setup:
>
> MacOS Catalina,
> Apache,
> SSL
> web2py
>
> I've been unable to install apache modules. Is this because of the new 
> System Integrity Protection (SIP)? Would anyone with more experience be 
> able to point me in the right direction?
>
> Thanks
>
>

-- 
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/24363fe0-ea20-4bf6-b118-22a163bada10%40googlegroups.com.


[web2py] Re: py4web in Google App Engine route app

2020-03-21 Thread Massimo Di Pierro
This is a good solution. One trick is to symlink _default to myapp

On Monday, 16 March 2020 02:17:56 UTC-7, Jacinto Parga wrote:
>
> Finally solved.
>
>1. I add an entrypoint to the app.yaml . The app runs fine:
>runtime: python37
>entrypoint: gunicorn -b :8080 -w 2 main:app 
>
>
># Handlers define how to route requests to your application.
>handlers:
>
>- url: /.*
>  secure: always
>  redirect_http_response_code: 301
>  script: auto
>
>2. I get rid off all the apps but the default app and the app I want 
>to deploy in the .gcloudignore:
># This file specifies files that are *not* uploaded to Google Cloud 
>Platform
># using gcloud. It follows the same syntax as .gitignore, with the 
>addition of
># "#!include" directives (which insert the entries of the given 
>.gitignore-style
># file at that point).
>#
># For more information, run:
>#   $ gcloud topic gcloudignore
>#
>.gcloudignore
># If you would like to upload your .git directory, .gitignore file or 
>files
># from your .gitignore file, remove the corresponding line
># below:
>.git
>.gitignore
>
># Python pycache:
>__pycache__/
># Ignored by the build system
>/setup.cfg
>
>.travis.yml
>*.pyc
>*.pyo
>*~
>#*
>*.1
>*.bak
>*.bak2
>*.svn
>*.w2p
>*.class
>*.rej
>*.orig
>Thumbs.db
>.DS_Store
>./deposit
>./benchmark
>./build
>./dist
>./ssl
>./docs
>./logs
>./*.zip
># Only ignore the default app and the app we want to deploy
>env/*
>env/
>!apps/*
>apps/todo
>apps/todo/*
>apps/examples
>apps/examples/*
>apps/_dashboard
>apps/_dashboard/*
>apps/_scaffold
>apps/_scaffold/*
>apps/_minimal
>apps/_minimal/*
>!apps/_default
>!apps/_default/*
>!apps/myapp
>!apps/myapp/*
>apps/_documentation/*
>apps/superheroes
>apps/superheroes/*
>apps/myfeed
>apps/myfeed/*
>apps/*/databases/README*
>pps/*/databases/*
>apps/*/uploads/*
>apps/*/*.py[oc]
>packages/
>deployment_tools/*
>deployment_tools/
>tests/*
>tests/
>README.md
>test-requirements.txt
>source-context.json
>password.txt
>py4web-start.py
>setup.py
>Makefile
>So when it is deployed in GAE http://myapp.appspot.com/ goes to 
>_default/index.html url
>3. I modify the __init.py__ file of the _default app to redirect to 
>myapp folder:
>from py4web import action, __version__
>from bottle import redirect  #get redirect function from bottle
>
>@action("index")
>@action.uses("index.html")
>def index():
>  redirect("/myapp")  # The former code: return 
>dict(version=__version__)
>The result is that http://myapp.appspot.com/ serves 
>http://myapp.app.com/myapp
>
> Maybe there is a more elegant way to get it. Any suggestion would be 
> appreciated.
>
> Thanks
>
> El martes, 4 de febrero de 2020, 19:46:32 (UTC+1), Jacinto Parga escribi贸:
>>
>> I cannot properly deploy a simple py4web app in GAE. I think it's just a 
>> .gcloudignore or a app.yaml configuration issue. The only thing I've got is 
>> a not found page.
>>
>> [image: minimal-py4web.png]
>>
>> Some help about how to route the right app in the google app engine?
>>
>> Thanks
>>
>>
>>
>>

-- 
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/2a1f1673-74ec-4ccd-a547-aee5e8074dd0%40googlegroups.com.


[web2py] Re: 6th book release

2020-03-21 Thread Massimo Di Pierro
The book online has some edits. Not major.

On Saturday, 14 March 2020 10:47:47 UTC-7, Andrea Fae' wrote:
>
> What are the differences between 5th book release and 6th online book 
> prerelease?
> thank you
>

-- 
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/0e5dcc3d-2951-471c-9932-e6d571a39df9%40googlegroups.com.


Re: [web2py] DId.app auth is good for web2py apps ?

2020-03-21 Thread Massimo Di Pierro
Did you get this to work. This is very valuable. I can help fix it during 
the week-end. Not going anywhere. ;-)


On Friday, 13 March 2020 06:00:40 UTC-7, Kevin Keller wrote:
>
> You need to change your okta tenant URLs  and the client Id and Secret. 
>
> I still points to my tenant :) 
>
>
>
>
> On Thu, Mar 12, 2020 at 3:05 PM Kevin Keller  wrote:
>
>> This goes into your db.py and you also need to install okta_jwt via pip. 
>>
>> I still haven figured it out how to terminate the session in Okta and 
>> Web2py at the same time
>>
>> The redirect in the logout terminates the okta session but not the web2py 
>> one.
>> For that you need session.forget and session.renew but this commands 
>> being in the model dont work, they only work in the controller. 
>> So need to find a way to destroy the sessions in the models through some 
>> sort of global variable or store the sessions in the DB retrieve them in 
>> the model and detroy them there. 
>>
>>
>>
>> On Thu, Mar 12, 2020 at 3:02 PM Kevin Keller  wrote:
>>
>>> Okta_CLIENT_ID='0x'
>>> Okta_CLIENT_SECRET="x"
>>>
>>> ## import required modules
>>> try:
>>> import json
>>> except ImportError:
>>> from gluon.contrib import simplejson as json
>>> from gluon.contrib.login_methods.oauth20_account import OAuthAccount
>>>
>>>
>>> ## extend the OAUthAccount class
>>> class OktaAccount(OAuthAccount):
>>> # """OAuth impl for FaceBook"""
>>> AUTH_URL="https://keller.okta.com/oauth2/default/v1/authorize";
>>> TOKEN_URL="https://keller.okta.com/oauth2/default/v1/token";
>>>
>>> def __init__(self):
>>> OAuthAccount.__init__(self, None, Okta_CLIENT_ID, Okta_CLIENT_SECRET,
>>> self.AUTH_URL, self.TOKEN_URL,
>>> scope='openid profile email',
>>> state="okta",
>>> display='popup')
>>>
>>>
>>> def get_user(self):
>>> if not self.accessToken():
>>> return None
>>> #global token
>>> token= None
>>> token=self.accessToken()
>>> print (token)
>>> from okta_jwt.jwt import validate_token
>>> issuer="https://keller.okta.com/oauth2/default";
>>> audience="api://default"
>>> if token != None:
>>> profile=validate_token(token, issuer, audience, Okta_CLIENT_ID)
>>> #print (profile)
>>> if profile['sub']:
>>>
>>> username = profile['sub']
>>>
>>>
>>> email = profile['sub']
>>> else:
>>> self.session.token = None
>>>
>>> if profile['sub']:
>>> return dict(first_name = profile['firstname'],
>>> last_name = profile['lastname'],
>>> username = username,
>>> email = '%s' %(email))
>>>
>>>
>>> def logout_new(self, next="/"):
>>> #self.session.token = None
>>> redirect('
>>> https://keller.okta.com/oauth2/default/v1/logout?id_token_hint='+token+
>>> '&post_logout_redirect_uri='+'
>>> http://130.61.243.125:8000/OktaWF/default/index')
>>> session.renew(clear_session=True)
>>> session.forget(response)
>>> return next
>>>
>>>
>>> auth.settings.login_form=OktaAccount()
>>>
>>> On Wed, Mar 11, 2020 at 4:01 PM Ant贸nio Ramos  
>>> wrote:
>>>
 Thank you Kevin , please share...


 Em qua., 11 de mar. de 2020 脿s 14:53, Kevin Keller  
 escreveu:

> Looks nice enough, though it is missing an easy way to configure 
> scopes and claims. 
>
> It dont see it anywhere in their free account actually. 
>
> I would probably rather advice to go with Auth0 or Okta. 
>
> I work for Okta so that is why I have integrated web2py with Okta in a 
> sample app. 
> I can send you the configuration and they have a free edition too for 
> 1000 users per month just like 
> DID and you can easily configure claims and scopes. 
>
> If you do not trust me on this go with Auth0, they can also help with 
> claims and scopes and I think 
> its free for 1000 users too, but Auth0 requires to do some scripting 
> to configure your scopes on the Auth0 web client. 
>
> So I think Okta is easier, but its just my 2 cents of course. 
>
>
>
>
> On Wed, Mar 11, 2020 at 2:02 PM Ant贸nio Ramos  
> wrote:
>
>> DID  is an Identity Provider, that authenticates 
>> users by verifying access to either an email address or securely stored 
>> private key.
>>
>> This gives users the ability to sign in with a single click without 
>> being tracked by the social login providers.
>>
>> It gives developers the ability to offer a modern authentication 
>> without having to handle validating signatures, recovering accounts from 
>> lost devices or verifying user email addresses.
>>
>>
>>
>> https://did.app/ 
>>
>>
>> regards 
>>
>> -- 
>> 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 fr