[web2py] Fwd: (DRAFT) Beta Launch of Cloud Developmet Platform with Support for PY4WEB, WEB2PY, EMMETT and others

2024-05-10 Thread Kevin Keller
Hello everyone,

We (John and I)  would like to invite you to try our Cloud Development
Platform, which we call WEBSSON ,
which lets you create PY4WEB, WEB2PY and EMMETT environments fully hosted
in the Cloud in a matter of clicks and use a Cloud based developer
workspace for code editing such as with VSCode in one go.

You can of course also create fully hosted databases and other things in
the same environment as well.

We saw the popularity of Pythonanywhere here, but thought we can do
something better and after almost 2 years of development we are finally
ready to do a soft launch / beta programme to get your feedback.

[image: 15_create_env_finish.png]


This is the home page:

https://portal.fineupp.com/websson/


Please find the current HowTo to create a PY4WEB environment here:

https://blog.social.fineupp.com/2024/05/01/py4web-part1/

https://blog.social.fineupp.com/2024/05/08/py4web-quickstart-part-2/

Videos how to do those things will be uploaded next week here:

https://www.youtube.com/channel/UCBHT4Lg-XL9l5eW13ZtMyFw


Other programming languages and frameworks are also supported (Django,
Flask, FastAPI, Angular, Vue.JS, Laravel, Spring Boot, Ruby on Rails etc.)
and you can also use the programming languages we currently support
(Python, PHP, Java, Node, Ruby)  without a framework pre-installed and
install your own framework.

For example installing Python with a Jupyter notebook or VSCode without a
web framework is also possible in order to create a quick online REPL to
try out some code.

In any case, Python with PY4WEB, WEB2PY and EMMETT are "first class
citizens" here obviously.

Feel free to create a separate Vue.JS project for example though and
connect your Vue.JS project with a PY4WEB backend API for example.


Since this is a *beta* release, you may find some typos or you may even
encounter a bug here and there, please let us know what happened or your
general thoughts.

Other features include:

   - Shell access with the ability to use Conda for custom Python
   interpreter installation and packages available from PyPi and Condaforge.
   Conda is provided via Mamba.


   - This way you can also install your own custom Python framework / API
   if you like.


   - ASDF package manager available to easily add additional
   programming languages or frameworks e.g. Node.JS (e.g.
   https://github.com/asdf-vm/asdf-nodejs)


   - Collaboration / Safe Code Sharing support:


   - You can safely isolate folders that contain your code and share them
   with other developers which will have their VSCode or Jupyter IDEs to work
   with you on a project at the same time without exposing any or your other
   project code. This is also especially useful if you are a professor or
   teacher.


   - Hosted SQL/NoSQL database support


   -  (PostgreSQL, SQlite, MariaDB, MySQL, FerretDB[MongoDB drop in],
   CouchDB, Redis). Redis hosting offering will be replaced with the
   Valkey Redis fork however next week due to the same license restrictions
   introduced that forces us to offer a MongoDB drop in replacement FerretDB.


   - Hosted database admin interfaces such as PHPMyAdmin, PGAdmin,
   RedisCommaner, Mongo Express


   - Internet traffic is unrestricted and not metered (we will likely have
   to meter traffic in the future to scale though). So you can also connect to
   other PaaS databases or APIs as you see fit as well.


   - Hosted VSCode and/or Jupyter notebook with unlimited terminal support


   - SSH access support so you can connect with VSCode or PyCharm desktop
   applications to edit your code or use your own SSH terminal.


   - Ability to add additional HTTP user / password or take your web site
   offline


   - Standalone Web terminal


   - Custom Domain(s) support


   - Ability to add additional web workers / instances for scalability with
   the click of a button


   - Ability to define a specific Py4Web / Web2py app as default home page
   / index page


   - 5GB of storage in the lowest tier




You can try everything free of charge as listed with a 30 day free trial.

The lowest tier provides everything listed above on a 5 Euros / Dollars
monthly subscription.

At the moment the only supported hostling location is in Falkenstein /
Germany.

However, we will be able to support different locations and Cloud Service
Providers down the line. Let us know which locations and / or Cloud
providers would be interesting.

John and I have been rather silent in the last 1-2 years due us working
furious on this and are now excited to the progress we have made so far
with you.

Us being part of the PY4WEB / WEB2PY community means we want to provide
first class support for those frameworks including the EMMETT framework and
thus want to launch our beta with you.


We are also considering to focus on the academic and university use cases
and to further extend the support for safe code sharing and collaboration
at scale.

So we would be especially 

Re: [web2py] Rocket bug in web2py 2.21.1?

2021-08-08 Thread Kevin Keller
Use the newest version from github.

There the issue is fixed.



Am So., 8. Aug. 2021 um 21:32 Uhr schrieb 'jimka...@yahoo.com' via
web2py-users :

> Hi,
> Finally migrated to 2.21.1 on macOS BigSur, using Python 3.9.6
>
> Good news is that everything so far seems to work fine but there is a
> puzzling Rocket issue.
>
> redownloaded 2.21.1 from the web2py site a couple of days ago, so should
> be up-to-date.
>
> When starting up, the following comes up:
>
> *web2py Web Framework*
>
> *Created by Massimo Di Pierro, Copyright 2007-2021*
>
> *Version 2.21.1-stable+timestamp.2020.11.28.04.10.44*
>
> *Database drivers available: sqlite3, imaplib, pymysql*
>
>
> *please visit:*
>
> *http://127.0.0.1:8000/ *
>
> *use "kill -SIGTERM 14337" to shutdown the web2py server*
>
> *Traceback (most recent call last):*
>
> *  File "/Applications/web2py_dev/./web2py.py", line 58, in *
>
> *gluon.widget.start()*
>
> *  File "/Applications/web2py_dev/gluon/widget.py", line 907, in start*
>
> *server.start()*
>
> *  File "/Applications/web2py_dev/gluon/main.py", line 781, in start*
>
> *self.server.start()*
>
> *  File "/Applications/web2py_dev/gluon/rocket.py", line 716, in start*
>
> *while self._monitor.isAlive():*
>
> *AttributeError: 'Monitor' object has no attribute 'isAlive'*
>
> *Python Version = 3.9.6*
>
> *python_lib =
> /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages*
> I assume this is not peculiar to us?? though I don't see a discussion of
> this topic in this group.
> Having looked at the offending code a bit, it seems true that the Monitor
> object in Rocket does not have a 'isAlive' attribute.
>
> Puzzled. Am I missing something?
>
> Thanks,
> Jim
>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/web2py/e48e945c-d4c1-432d-a595-c015bf6ddd07n%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/CADHCKLSiBik33_T5BnMLSruRoDvnyfC_fE75_UdVy98ZXG5JoQ%40mail.gmail.com.


Re: [web2py] How to read image in blob format from a existing db

2021-05-19 Thread Kevin Keller
I filed a bug report for this on the pydal and py4web repo.



Am Di., 18. Mai 2021 um 20:45 Uhr schrieb Kevin Keller :

> Potentially. I woukd file a problem in github and use raw sql as
> workaround for now.
>
> Adding the py4web community to this
>
>
>
>
>
> On Tue, May 18, 2021, 20:23 Chris  wrote:
>
>> I could do it with pydal but with sqlite3 library worked perfect. Is
>> maybe a pydal bug ?
>>
>>
>> Cheers.
>>
>> --
>> Sent from Canary <https://canarymail.io>
>>
>> On martes, may. 18, 2021 at 1:59 p. m., Chris 
>> wrote:
>> Data is already in binary in db.
>>
>>
>>
>> Making more test when pydal retrieve the blob data from the db is only
>> getting just a part of the information.
>>
>> When in print the rows after the select i get a small sample like this:
>>
>> images = cherry_db(cherry_db.image.node_id ==
>> i['node_id']).select(cherry_db.image.node_id, cherry_db.image.png)
>>
>> for m in images:
>>print(m['png’])
>>
>> b'<\xd1\x88\x1c4l\x04\x84\xce 0\x13\xc6\x01\r\xdd\xd0'
>>
>>
>> Cheers
>>
>> --
>> Sent from Canary <https://canarymail.io>
>>
>> On martes, may. 18, 2021 at 1:51 p. m., Kevin Keller 
>> wrote:
>> I think you have to convert the image file to binary data before saving
>> tad blob etc..?
>>
>>
>> https://pynative.com/python-mysql-blob-insert-retrieve-file-image-as-a-blob-in-mysql/
>>
>>
>>
>> On Tue, May 18, 2021, 19:04 Chris  wrote:
>>
>>> Hi, i’m trying to read images from a existing sqlite db. For some reason
>>> when i save the images to disk, they are corrupted.
>>> this is my code:
>>>
>>> cherry_db = DAL('sqlite://{}'.format(form.vars.cherry_file),
>>> folder=upload_folder, migrate=False)
>>>
>>> cherry_db.define_table('image',
>>> Field('node_id', 'integer', requires=IS_NOT_EMPTY()),
>>> Field('png', 'blob')
>>> )
>>>
>>> images = cherry_db(cherry_db.image.node_id ==
>>> i['node_id']).select(cherry_db.image.node_id, cherry_db.image.png)
>>>
>>> for m in images:
>>>name = str(uuid.uuid4())
>>>print('image {}'.format(name))
>>>print(m['png'])
>>>im = open('{}'.format(session.project_folder+'/'+name+'.png'), 'wb')
>>>im.write(m['png'])
>>>im.close()
>>>
>>>
>>> Any help is appreciated
>>>
>>> Cheers.
>>> Chris.
>>>
>>> --
>>> Sent from Canary <https://canarymail.io>
>>>
>>> --
>>> 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/30b99d7b-941c-4387-80cd-9f521399af82%40Canary
>>> <https://groups.google.com/d/msgid/web2py/30b99d7b-941c-4387-80cd-9f521399af82%40Canary?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/CADHCKLTUpqY99R9qfcgvJ7Thi9263LSbtD2XJx6NjEym-kLQgQ%40mail.gmail.com
>> <https://groups.google.com/d/msgid/web2py/CADHCKLTUpqY99R9qfcgvJ7Thi9263LSbtD2XJx6NjEym-kLQgQ%40mail.gmail.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 subsc

Re: [web2py] How to read image in blob format from a existing db

2021-05-18 Thread Kevin Keller
Potentially. I woukd file a problem in github and use raw sql as workaround
for now.

Adding the py4web community to this





On Tue, May 18, 2021, 20:23 Chris  wrote:

> I could do it with pydal but with sqlite3 library worked perfect. Is maybe
> a pydal bug ?
>
>
> Cheers.
>
> --
> Sent from Canary <https://canarymail.io>
>
> On martes, may. 18, 2021 at 1:59 p. m., Chris 
> wrote:
> Data is already in binary in db.
>
>
>
> Making more test when pydal retrieve the blob data from the db is only
> getting just a part of the information.
>
> When in print the rows after the select i get a small sample like this:
>
> images = cherry_db(cherry_db.image.node_id ==
> i['node_id']).select(cherry_db.image.node_id, cherry_db.image.png)
>
> for m in images:
>print(m['png’])
>
> b'<\xd1\x88\x1c4l\x04\x84\xce 0\x13\xc6\x01\r\xdd\xd0'
>
>
> Cheers
>
> --
> Sent from Canary <https://canarymail.io>
>
> On martes, may. 18, 2021 at 1:51 p. m., Kevin Keller 
> wrote:
> I think you have to convert the image file to binary data before saving
> tad blob etc..?
>
>
> https://pynative.com/python-mysql-blob-insert-retrieve-file-image-as-a-blob-in-mysql/
>
>
>
> On Tue, May 18, 2021, 19:04 Chris  wrote:
>
>> Hi, i’m trying to read images from a existing sqlite db. For some reason
>> when i save the images to disk, they are corrupted.
>> this is my code:
>>
>> cherry_db = DAL('sqlite://{}'.format(form.vars.cherry_file),
>> folder=upload_folder, migrate=False)
>>
>> cherry_db.define_table('image',
>> Field('node_id', 'integer', requires=IS_NOT_EMPTY()),
>> Field('png', 'blob')
>> )
>>
>> images = cherry_db(cherry_db.image.node_id ==
>> i['node_id']).select(cherry_db.image.node_id, cherry_db.image.png)
>>
>> for m in images:
>>name = str(uuid.uuid4())
>>print('image {}'.format(name))
>>print(m['png'])
>>im = open('{}'.format(session.project_folder+'/'+name+'.png'), 'wb')
>>im.write(m['png'])
>>im.close()
>>
>>
>> Any help is appreciated
>>
>> Cheers.
>> Chris.
>>
>> --
>> Sent from Canary <https://canarymail.io>
>>
>> --
>> 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/30b99d7b-941c-4387-80cd-9f521399af82%40Canary
>> <https://groups.google.com/d/msgid/web2py/30b99d7b-941c-4387-80cd-9f521399af82%40Canary?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/CADHCKLTUpqY99R9qfcgvJ7Thi9263LSbtD2XJx6NjEym-kLQgQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/web2py/CADHCKLTUpqY99R9qfcgvJ7Thi9263LSbtD2XJx6NjEym-kLQgQ%40mail.gmail.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/3f7419fc-a9e0-4ca6-b031-dd2839be2ca4%40Canary
> <https://groups.google.com/d/msgid/web2py/3f7419fc-a9e0-4ca6-b031-dd2839be2ca4%40Canary?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/CADHCKLRXA%2BTxUVjdtumZ19b%3DwBUXuTqkBWLXK-rd8TUpteuj%2BA%40mail.gmail.com.


Re: [web2py] How to read image in blob format from a existing db

2021-05-18 Thread Kevin Keller
I think you have to convert the image file to binary data before saving tad
blob etc..?

https://pynative.com/python-mysql-blob-insert-retrieve-file-image-as-a-blob-in-mysql/



On Tue, May 18, 2021, 19:04 Chris  wrote:

> Hi, i’m trying to read images from a existing sqlite db. For some reason
> when i save the images to disk, they are corrupted.
> this is my code:
>
> cherry_db = DAL('sqlite://{}'.format(form.vars.cherry_file),
> folder=upload_folder, migrate=False)
>
> cherry_db.define_table('image',
> Field('node_id', 'integer', requires=IS_NOT_EMPTY()),
> Field('png', 'blob')
> )
>
> images = cherry_db(cherry_db.image.node_id ==
> i['node_id']).select(cherry_db.image.node_id, cherry_db.image.png)
>
> for m in images:
>name = str(uuid.uuid4())
>print('image {}'.format(name))
>print(m['png'])
>im = open('{}'.format(session.project_folder+'/'+name+'.png'), 'wb')
>im.write(m['png'])
>im.close()
>
>
> Any help is appreciated
>
> Cheers.
> Chris.
>
> --
> Sent from Canary 
>
> --
> 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/30b99d7b-941c-4387-80cd-9f521399af82%40Canary
> 
> .
>

-- 
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/CADHCKLTUpqY99R9qfcgvJ7Thi9263LSbtD2XJx6NjEym-kLQgQ%40mail.gmail.com.


Re: [web2py] QR code generation from markmin

2021-03-02 Thread Kevin Keller
Hey Peter!

I don't see any code in the markmin python script that could generate qr
codes.

I think the ones that are there are static.

You can use a qr code generator lib with python and combine with markmin qr
Syntax though.

I think.



On Mon, Mar 1, 2021, 15:59 Peter Woolf  wrote:

> Hello,
> I see that web2py has documentation for generating QR codes from links
> using markmin, but it isn't working in my hands.  Am I doing it incorrectly
> or is there a bug?
>
> Here is a minimal example of code in a view:
> ---
> {{from gluon.contrib.markmin.markmin2html import markmin2html}}
> {{=XML(markmin2html("Hello **world** [[link qr:http://web2py.com]];))}}
> {{=markmin2html("Hello **world** [[link qr:http://web2py.com]];)}}
> 
> This just creates a normal link:
>
> ---
>
> Hello *world* link
> Hello world http://web2py.com
> ">link
>
> --
>
> Thoughts?  Seems a useful feature if it really exists in there! :)
>
> Thanks,
>
> --Peter
>
> --
> 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/57f0ea98-db5a-4211-9e24-e8ce3d7271fbn%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/CADHCKLQO5RoExJFYe--F%3DOhNybWcHGQOC_tVwkHbFk7vjJmtoA%40mail.gmail.com.


Re: [web2py] py4web jwt ?

2021-03-01 Thread Kevin Keller
What are the current files that would need to be fixed to be pyjwt 2
compatible?

auth and form no?

Anything else?


[image: cloudHQ] <https://www.free-email-tracker.com> Powered by
cloudHQ <https://www.free-email-tracker.com>

Am Mo., 1. März 2021 um 09:02 Uhr schrieb Nico Zanferrari <
nicoz...@gmail.com>:

> BTW,
>
> in fact JWT  is cited here :
> https://py4web.com/_documentation/static/en/chapter-04.html#sessions -
> and I'm even currently working for expanding it ;-)
>
> Nico
>
> Il giorno ven 26 feb 2021 alle ore 19:55 Richard Vézina <
> ml.richard.vez...@gmail.com> ha scritto:
>
>> Thanks
>>
>> On Fri, Feb 26, 2021 at 1:43 PM Kevin Keller  wrote:
>>
>>> Look for the email thread with the following title in the py4web google
>>> group and you ll find a way:
>>>
>>> Sample Code simple JWT Auth for pydal API
>>>
>>>
>>> in the
>>>
>>>
>>> [image: cloudHQ] <https://www.free-email-tracker.com> Powered by
>>> cloudHQ <https://www.free-email-tracker.com>
>>>
>>> Am Fr., 26. Feb. 2021 um 19:39 Uhr schrieb Richard Vézina <
>>> ml.richard.vez...@gmail.com>:
>>>
>>>> UP!
>>>>
>>>> Is py4web has jwt token mechanism??
>>>>
>>>> Evaluating py4web currently (yes getting back to good stuff loved
>>>> web2py and pydal)...
>>>>
>>>> I would need py4web to support jwt (https://jwt.io/). I recall that
>>>> been implement in web2py
>>>>
>>>> Not found anything in the doc about it :
>>>> https://py4web.com/_documentation/static/en/chapter-11.html
>>>>
>>>> Thanks
>>>>
>>>> Richard
>>>>
>>>> On Thu, Feb 20, 2020 at 2:19 PM Val K  wrote:
>>>>
>>>>> As I know py2web already stores _session_token as jwt, no?
>>>>>
>>>>> On Thursday, February 20, 2020 at 10:00:00 PM UTC+3, Kevin Keller
>>>>> wrote:
>>>>>>
>>>>>> With a Spa the routing is done in Javascript in the Browser.
>>>>>>
>>>>>> So Javascript or Vue / React etc need. To check if the user has a
>>>>>> access or id_token and if not redirect to the login page to obtain it.
>>>>>>
>>>>>> Doing crud and be able to secure those crud rest routes will be
>>>>>> critical for productivity.
>>>>>>
>>>>>> So we need a simple jwt token minting engine that at least can spit
>>>>>> out a access token for prototyping and and easy way to switch over to 
>>>>>> other
>>>>>> IAM solutions with py4web for production that can do the token minting.
>>>>>>
>>>>>> That is something I am currently working on the whole oidc auth part
>>>>>> make it easy and I also want to make it available for web2py.
>>>>>>
>>>>>> I have updated and got the oauth2 login provider working with Okta
>>>>>> yesterday and web2py.
>>>>>>
>>>>>> Will share this. Code asap and sent a push to git to have that
>>>>>> provider updated and at some providers for different IAM solutions for 
>>>>>> both
>>>>>> web2py and py4web going forward.
>>>>>>
>>>>>> Will try to share an example with py4web asap once I have something
>>>>>> working.
>>>>>>
>>>>>> Will probaly be on the. Weekend.
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Thu, 20 Feb 2020, 10:42 Val K,  wrote:
>>>>>>
>>>>>>> check request.content_type - is that 'application/json' ?
>>>>>>>
>>>>>>> On Thursday, February 20, 2020 at 9:28:43 PM UTC+3, Ramos wrote:
>>>>>>>>
>>>>>>>> getting this from py4web as an api.
>>>>>>>> [image: image.png]
>>>>>>>> Is not what i would like to see from a SPA standpoint.
>>>>>>>>
>>>>>>>> Regards
>>>>>>>> António
>>>>>>>>
>>>>>>>>
>>>>>>>> Em qui., 20 de fev. de 2020 às 18:03, Val K 
>>>>>>>> escreveu:
>>>>>>>>
>

Re: [web2py] py4web jwt ?

2021-02-26 Thread Kevin Keller
Look for the email thread with the following title in the py4web google
group and you ll find a way:

Sample Code simple JWT Auth for pydal API


in the


[image: cloudHQ] <https://www.free-email-tracker.com> Powered by
cloudHQ <https://www.free-email-tracker.com>

Am Fr., 26. Feb. 2021 um 19:39 Uhr schrieb Richard Vézina <
ml.richard.vez...@gmail.com>:

> UP!
>
> Is py4web has jwt token mechanism??
>
> Evaluating py4web currently (yes getting back to good stuff loved web2py
> and pydal)...
>
> I would need py4web to support jwt (https://jwt.io/). I recall that been
> implement in web2py
>
> Not found anything in the doc about it :
> https://py4web.com/_documentation/static/en/chapter-11.html
>
> Thanks
>
> Richard
>
> On Thu, Feb 20, 2020 at 2:19 PM Val K  wrote:
>
>> As I know py2web already stores _session_token as jwt, no?
>>
>> On Thursday, February 20, 2020 at 10:00:00 PM UTC+3, Kevin Keller wrote:
>>>
>>> With a Spa the routing is done in Javascript in the Browser.
>>>
>>> So Javascript or Vue / React etc need. To check if the user has a access
>>> or id_token and if not redirect to the login page to obtain it.
>>>
>>> Doing crud and be able to secure those crud rest routes will be critical
>>> for productivity.
>>>
>>> So we need a simple jwt token minting engine that at least can spit out
>>> a access token for prototyping and and easy way to switch over to other IAM
>>> solutions with py4web for production that can do the token minting.
>>>
>>> That is something I am currently working on the whole oidc auth part
>>> make it easy and I also want to make it available for web2py.
>>>
>>> I have updated and got the oauth2 login provider working with Okta
>>> yesterday and web2py.
>>>
>>> Will share this. Code asap and sent a push to git to have that provider
>>> updated and at some providers for different IAM solutions for both web2py
>>> and py4web going forward.
>>>
>>> Will try to share an example with py4web asap once I have something
>>> working.
>>>
>>> Will probaly be on the. Weekend.
>>>
>>>
>>>
>>>
>>>
>>>
>>> On Thu, 20 Feb 2020, 10:42 Val K,  wrote:
>>>
>>>> check request.content_type - is that 'application/json' ?
>>>>
>>>> On Thursday, February 20, 2020 at 9:28:43 PM UTC+3, Ramos wrote:
>>>>>
>>>>> getting this from py4web as an api.
>>>>> [image: image.png]
>>>>> Is not what i would like to see from a SPA standpoint.
>>>>>
>>>>> Regards
>>>>> António
>>>>>
>>>>>
>>>>> Em qui., 20 de fev. de 2020 às 18:03, Val K 
>>>>> escreveu:
>>>>>
>>>>>> It seems it depends on request.content_type
>>>>>>
>>>>>> https://github.com/web2py/py4web/blob/e6b3d5e10e15976af153c4a4e6b349a02fe6c2a9/py4web/utils/auth.py#L35
>>>>>>
>>>>>> --
>>>>>> 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/9608a9ab-d338-4580-9d02-31b9b9a30782%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 web...@googlegroups.com.
>>>> To view this discussion on the web visit
>>>> https://groups.google.com/d/msgid

Re: [web2py] Re: auth.signature not working

2021-02-15 Thread Kevin Keller
How did you solve it?

On Mon, Feb 15, 2021, 17:33 António Ramos  wrote:

> Thank you Jim but i found the problem.
> My fault this time.
> Thank you again.
>
> PS. Its just me or this forum is abandoned? Should i go elsewhere for help
> ?
>
> Em seg., 15 de fev. de 2021 às 15:46, António Ramos 
> escreveu:
>
>> Hi Jim
>> Sorry but dont understand your suggestion.
>> You mean auth.requires_login() on my restful function like this
>> @auth.requires_login() ?
>> @request.restful()
>> def uploadInvoice():
>> Does it make sense? Its going to be called by external script.
>> Inside my  uploadInvoice i have
>> user = auth.login_bare("myuser", "pwd") and i can check that it returns
>> the myuser ID. so before inserting a record it should know who the user is.
>>
>> I also have this code that i suspect that could get auth.signature in
>> trouble.
>> Please comment .
>>
>>
>> db.entities._after_update.append(lambda s, f
>> : wfFields().update_readers(db, 'entities', s, f))
>> db.entities._after_update.append(lambda s, f
>> : wfFields().update_authors(db, 'entities', s, f))
>> db.entities._after_update.append(lambda s, f: extrafields_sync(s, f))
>> db.entities._after_insert.append(lambda f, id: extrafields_sync(db(
>> db.entities.id==id), f))
>>
>> Em seg., 15 de fev. de 2021 às 15:33, Jim S 
>> escreveu:
>>
>>> Have you tried with an auth decorator?  Maybe auth.requires_login()?
>>>
>>> -Jim
>>>
>>> On Saturday, February 13, 2021 at 3:33:01 PM UTC-6 Ramos wrote:
>>>
 Anybody here?

 Em sex., 12 de fev. de 2021 às 23:57, António Ramos 
 escreveu:

> hello this is my model
> db.define_table(
> 'entities',
> Field('uuid', length=64, default=lambda: str(uuid.uuid4())),
> Field('entity', 'string',length=70,required=True, label=T("Entity"
> )),
> Field('description', length=100,label=T("Description"), default=""
> ),
> Field('status', db.status),
> Field('type', 'reference dbentities', label=T("Type")),
> Field('sub_type', "reference subtypes", label=T("Type")),
> Field('event','string',length=10),
> Field('trailevent', 'list:integer'),
> Field("last_error", default=""),
> Field('extrareaders', 'list:reference auth_user'),
> Field('extrafield', db.extrafields, requires=IS_EMPTY_OR(
> IS_IN_DB(db, 'extrafields.id', '%(extrafield)s'))),
> Field('relatedto', 'reference entities', requires=IS_EMPTY_OR(
> IS_IN_DB(db, 'entities.id', '%(entity)s'))),
> Field('file', 'upload', label="Ficheiro"),
> Field('valstart', 'date', label="Válido de",
>   default=datetime.datetime.utcnow()),
> Field('valend', 'date', label="Válido até",
>   default=datetime.datetime.utcnow()),
> Field('orderedat', 'float'),
> Field('question','string'),
> Field('qt','double'),
> Field('units','string',length=5),
> Field('readers', 'list:string', default=[""]),#friend uuid
> Field('details','json'),
> auth.signature,
> format='%(type)s %(entity)s',
> )
>
>
> I have auth.signature but  this code
>
> @request.restful()
> def uploadInvoice():
> import random
> import string
> response.view = 'generic.json'
>
> def POST(*args, **kw):
> try:
> user = auth.login_bare("userxxx", "") # so it has a
> user
> uploaded_file = kw['file']
> filename =
>  db.entities.file.store(uploaded_file, uploaded_file.filename)
> id = db.entities.insert(
> entity="Invoice",
> type=db.dbentities(entity="Invoice")["id"],
> status=DBTools().setStatus(db,"Draft", "Invoice"),
> file=filename,
> created_by=4, # even with this line it saves as None
> modified_by=4, # even with this line it saves as None
> description="")
> if id:
> eventid = db.events.insert(
> event="Invoice", relatedto=id,  type=
> "Document added", receipts={},linktodoc=id
> )
> db.entities[id]=dict(event=eventid)
> return "ok"
>
> except Exception as e:
> raise Exception('Error on line {}{}{}'.format(
> sys.exc_info()[-1].tb_lineno, str(e), request.vars))
> return locals()
>
> does not fills the created_by and modified_by field. They have None
>
> Any help ???
> 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

Re: [web2py] PostgreSQL error on db.currs_stats[0] = {..}

2020-11-14 Thread Kevin Keller
Probably also something for @Leonel Câmara  .

Can you compare the raw sql of Mysql and PostgreSQL of what you are
trying to do please?

And post it here, then we can probably see what needs to be done.

Thanks!

Am Sa., 14. Nov. 2020 um 10:04 Uhr schrieb Dmitrii Ermolaev <
ermolaev.icrea...@gmail.com>:

> if not currs_stats:
>db.currs_stats[0] = {
>'curr_id': curr_id,
>'deal_id': deal_id,
>'average_': volume_out,
>'count_': 1,
>}
>
> on MySQl all work
>
> error: No such record: 0
>
> --
> 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/4237a051-f333-4464-a12e-ba76208a1f39n%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/CADHCKLSHBLf_d%3DU28J7er8phCNTSGA6gAUN%3D40iSg-vPGFamPg%40mail.gmail.com.


Re: [web2py] PostgreSQL - column "COLUMN" must appear in the GROUP BY clause or be used in an aggregate function LINE 1:

2020-11-14 Thread Kevin Keller
I think @Leonel Câmara  would know best what is
going on here.

My uneducated guess is that you are using Postgresql12 and that there were
some major changes from postgres11 to postgres12.
Either Pydal has not caught up yet, or since pydal is not strictly an ORM,
you just have to actually adapt your pydal statements a bit.

Try this:

for grp in db((db.pay_ins_stack.ref_==db.pay_ins.id)
& (db.pay_ins.ref_ == db.deal_acc_addrs.id )
& (db.deal_acc_addrs.xcurr_id == xcurr.id)
).select(groupby=(db.deal_acc_addrs.id),
pay_ins_stack.id):



Am Sa., 14. Nov. 2020 um 09:35 Uhr schrieb Dmitrii Ermolaev <
ermolaev.icrea...@gmail.com>:

>
> for grp in db((db.pay_ins_stack.ref_==db.pay_ins.id)
> & (db.pay_ins.ref_ == db.deal_acc_addrs.id )
> & (db.deal_acc_addrs.xcurr_id == xcurr.id)
> ).select(groupby=(db.deal_acc_addrs.id)):
>
> ERROR:
> column "pay_ins_stack.id" must appear in the GROUP BY clause or be used
> in an aggregate function LINE 1: SELECT "pay_ins_stack"."id",
> "pay_ins_stack"."ref_", "pay_in...
>
> With MySQL all work good !
>
> help please!
>
> --
> 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/c392a3bc-f748-468a-b74c-5c15fef6d20fn%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/CADHCKLQWBDmbJJVj6LGzU4uvz%3D7Ems5pPNvXH1DpX7UeZwv4Sg%40mail.gmail.com.


Re: [web2py] web2py docker container

2020-09-21 Thread Kevin Keller
Thank you!!

On Mon, Sep 21, 2020, 18:47 Christian Varas  wrote:

> Thanks! Is really useful :)
>
> El El lun, 21 de sep. de 2020 a la(s) 13:43, cabildocl 
> escribió:
>
>> Hello, I share with you the web2py docker container. include web2py,
>> python3, nginx and gunicorn.
>>
>>
>> https://hub.docker.com/r/cabildocl/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/3cd625dc-24c5-4ef2-94d2-a6d147247db4n%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%2BuJuksRYzih_HheF9S%3DoLkmp_J-BQ41pZUab9UXCNaFun2Q%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/CADHCKLTz14bwpgzf-GZz64WSakk%3DMzDgL60Xy7uDGxe9eqrLxA%40mail.gmail.com.


Re: [web2py] Custom JWT login -> Login validated user without a password.

2020-09-14 Thread Kevin Keller
Nope, its not stupid.

At least not as long as you store data in the local database of your app
that is not stored in the directory of your identity management system.
Then you would just duplicate data and I would just use the claims from the
IDM to work in the app.
But if your app stores data about the user that is not stored in the IDM
for example if you have a web shop and you want to store the
puchase history,
you probably do not want to store that in your IDM directory but leave in
the local database. In order for your app to understand what data to pull
for that user from
the local datatabase it is important to create the user entity in the local
app as well as have it the IDM.
I usually check if a user that just authenticated via the IDM is already in
the database and if not I create / update the user in the local database.

In terms loggin users in I think it web2py it was straight forward if I
remember correctly..

Looking at ths snipped:
http://www.web2pyslices.com/slice/show/1443/auto-login-when-you-come-from-localhost

I think you can extract the username from the token and then do:

user = db(db.auth_user.username==username).select().first()
auth.user = user




Am Mo., 14. Sept. 2020 um 08:14 Uhr schrieb hiro :

> Thank you! You are spot on. I have redirected the user to a Single Signon
> page, and got redirected back with a token, that I then use the requests
> library and my key to validate to extract the username and permissions.
>
> I already have the users in the default auth tables, so basically now that
> user X has provided av valid token I want to be able to login that user.
>
> Maybe that is just stupid? Maybe one should just use the extracted data as
> from the token and never store any of it in the internal user database?
>
>
>
> On Friday, September 11, 2020 at 5:13:18 PM UTC+2 kell...@gmail.com wrote:
>
>> I am not sure I understand what you have done completely, but let me give
>> it a shot at the point where you ask how to validate a jwt token.
>>
>> The IDP that created the JWT token will sign the JWT token.
>> So you need to send the token e.g. via POST to web2py and then use pyjwt
>> to verify the token with however means that token was signed.
>> Maybe a simple passphrase, shared key, public key etc.
>>
>> Once you verified the signature you can use pyjwt
>> to load the contents of the token into a python dict.
>> Some IDPs include information about the person loggin in as "claims".
>> Info such as First Name, Last Name, Email, Username/Displayname etc. you
>> can extract those information
>> and create the user in web2py and log the user in with a web2py session.
>>
>> Some IDPs do not put anything in the token and ask you to use the jwt
>> token to call a userinfo endpoint (restful api of the IDP),
>> to extract more info about the user directly from the IDP instead of from
>> the token.
>>
>> The token usually was issued with certian scopes e.g. openid, profile,
>> email and depending on the scopes of the token, the IDP will either
>> give this information or not.
>> Usually you also have to whitelist in the IDP from which hosts such a
>> call can come from and which hosts can actually obtain tokens etc.
>>
>>
>>
>> Am Fr., 11. Sept. 2020 um 16:06 Uhr schrieb hiro :
>>
>>> Hi, quick question!
>>>
>>> I am working on an internal API using web2py and the organization I am
>>> working for wants us to use JWTs. I have had no success with the JWTAuth in
>>> the tools file, but have successfully been able to redirect to the single
>>> sing-on provider and then validate the token as the single sign on provider
>>> redirects back to the web2py service.
>>>
>>> So basically I have been able to validate that a user with a given
>>> username is allowed to log in. Now, the question becomes, how do I log in
>>> the user?
>>>
>>> Assume the user already exists within the Auth DB for now. In the long
>>> run I will need to update user permission and LDAP groups and so on, but
>>> now I just need how to login problematically when I know the user is
>>> allowed to login by a validated JWT token, but I have no password or
>>> anything else except the username,
>>>
>>>
>>> # Code to validate JWT token..
>>>
>>> username = validated_jwt_token.preffered_username.
>>> Auth.login(username)
>>>
>>> # User should now be logged in.
>>>
>>> Any idea?
>>> 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+un...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/web2py/0c6cfe00-9e4d-416a-b547-76809c19e751o%40googlegroups.com
>>> 

Re: [web2py] deploy web2py with gunicorn, Nginx y HTTPS

2020-09-12 Thread Kevin Keller
Gracias!

Am Sa., 12. Sept. 2020 um 17:10 Uhr schrieb cabildocl :

> I wrote an article in Spanish on how to deploy web2py with https
>
>
> http://cabildocl.blogspot.com/2020/09/implementar-web2py-con-gunicorn-nginx-y.html
>
>
> --
> 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/05dee14b-7dd8-439f-88f5-68b759a43716n%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/CADHCKLRKz8pqwxigcNvi67G_nPFwLmT0d4CkWMmUUuaFugBjFg%40mail.gmail.com.


Re: [web2py] Custom JWT login -> Login validated user without a password.

2020-09-11 Thread Kevin Keller
I am not sure I understand what you have done completely, but let me give
it a shot at the point where you ask how to validate a jwt token.

The IDP that created the JWT token will sign the JWT token.
So you need to send the token e.g. via POST to web2py and then use pyjwt
to verify the token with however means that token was signed.
Maybe a simple passphrase, shared key, public key etc.

Once you verified the signature you can use pyjwt
to load the contents of the token into a python dict.
Some IDPs include information about the person loggin in as "claims".
Info such as First Name, Last Name, Email, Username/Displayname etc. you
can extract those information
and create the user in web2py and log the user in with a web2py session.

Some IDPs do not put anything in the token and ask you to use the jwt token
to call a userinfo endpoint (restful api of the IDP),
to extract more info about the user directly from the IDP instead of from
the token.

The token usually was issued with certian scopes e.g. openid, profile,
email and depending on the scopes of the token, the IDP will either
give this information or not.
Usually you also have to whitelist in the IDP from which hosts such a call
can come from and which hosts can actually obtain tokens etc.



Am Fr., 11. Sept. 2020 um 16:06 Uhr schrieb hiro :

> Hi, quick question!
>
> I am working on an internal API using web2py and the organization I am
> working for wants us to use JWTs. I have had no success with the JWTAuth in
> the tools file, but have successfully been able to redirect to the single
> sing-on provider and then validate the token as the single sign on provider
> redirects back to the web2py service.
>
> So basically I have been able to validate that a user with a given
> username is allowed to log in. Now, the question becomes, how do I log in
> the user?
>
> Assume the user already exists within the Auth DB for now. In the long run
> I will need to update user permission and LDAP groups and so on, but now I
> just need how to login problematically when I know the user is allowed to
> login by a validated JWT token, but I have no password or anything else
> except the username,
>
>
> # Code to validate JWT token..
>
> username = validated_jwt_token.preffered_username.
> Auth.login(username)
>
> # User should now be logged in.
>
> Any idea?
> 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/0c6cfe00-9e4d-416a-b547-76809c19e751o%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/CADHCKLSb8r_ePec%2B6c8iEWiru_zQL9pYsEBB1k5N-LbpKCw_4g%40mail.gmail.com.


[web2py] QuicknDirty How-To for SSO between web2py and py4web with KeyCloak

2020-08-31 Thread Kevin Keller
In web2py put this in your db.py:

# Define oauth application id and secret.
Kcloak_CLIENT_ID=''
Kcloak_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 KCloakAccount(OAuthAccount):
#"""OAuth impl for KeyCloak"""

AUTH_URL="http(s)://KEYCLOAKIPANDPORT/auth/realms/master/protocol/openid-connect/auth"

TOKEN_URL="http(s)://KEYCLOAKIPANDPORT/auth/realms/master/protocol/openid-connect/token"

def __init__(self):
   OAuthAccount.__init__(self, None, Kcloak_CLIENT_ID,
Kcloak_CLIENT_SECRET,
  self.AUTH_URL, self.TOKEN_URL,
  scope='openid profile email',
  state="klcoak",
  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="http(s)://KEYCLOAKIPANDPORT/auth/realms/master"
audience="http(s)://YOURWEB2PYPAGEURL"
import jwt
profile=jwt.decode(token,verify=False)
if profile['sub']:
 username = profile['email']
 email = profile['email']
 first_name = profile['given_name']
 last_name = profile['family_name']
 return dict(username = username,
first_name=first_name,last_name=last_name,email = '%s' %(email))


else:
  self.session.token = None

and put this in your

gluon/contrib/login_methods/oauth20_account.py

replace whatever you have under the logout function with:

del current.session.token
del current.session.auth
current.session.token = None
current.session.auth = None

redirect('http(s)://KEYCLOAKIPPORT/auth/realms/master/protocol/openid-connect/logout?redirect_uri=*ENCODEDURLTOREDIRECTAFTERLOGOUT"
')


End Web2py part.


For py4web:

Create oauth2keycloak.py file in py4web/utils/auth_plugins/ and put in this:


from . import OAuth2


class OAuth2Keycloak(OAuth2):
name = "oauth2keycloak"
login_url =
"http(s)://KEYCLOAKIPPORT/auth/realms/master/protocol/openid-connect/auth"
token_url =
"http(s)://KEYCLOAKIPPORT/auth/realms/master/protocol/openid-connect/token"
userinfo_url =
"http(s)://KEYCLOAKIPPORT/auth/realms/master/protocol/openid-connect/userinfo"
revoke_url =
"http(s)://KEYCLOAKIPPORT/auth/realms/master/protocol/openid-connect/logout"
default_scope = "openid profile"
maps = {
"username": "email",
"email":"email",
"sso_id": "email",
"first_name": "given_name",
"last_name": "family_name",
}


In your app (probably based on scaffold) go to your
static/components/auth.html and add a button for KeyCloak:

Login with
KeyCloak

Also in your scaffoled app add the plugin to the auth.html file under
templates:


  


Finally for single logout add this line to your logout function in
py4web/utils/auth.py

526 elif path == "logout":

527 self.session.clear()

528 redirect
('http(s)://KEYCLOAKIPPORT/auth/realms/master/protocol/openid-connect/logout?redirect_uri=*ENCODEDREDIRECTURIAFTERLOGOUT*

Of course you need to install keycloak and create 2 openid clients with
secrets.

Thats it in a nutshell.

-- 
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/CADHCKLRPF27RunUJmWJWauFPMZses%2BHb3Vvsk%2Bap8Ktw0xYMrQ%40mail.gmail.com.


Re: [web2py] Re: Administration disable communication is insecure

2020-08-31 Thread Kevin Keller
You can either comment out the https requirement in the web2py framework

https://sites.google.com/site/tabot99/home/web2py-disable-https-admin-access

You will also comment out the same lines of code in the appadmin
application.

or

setup web2py and nginx with letsencrypt certificates on your linux server.

Here is the last email that I wrote how to do it with ubuntu 20.04:


Kevin Keller 
Do., 20. Aug., 15:45 (vor 11 Tagen)
an web2py-users
Hey everyone,

I struggled last night to setup web2py on my VPS Linux server which uses
ubuntu 20.04.

I had to update the script with multiple edits.

Most of them around new pip syntax, updated requirements of nginx for
self-signed certs and updated package names.

I will create a pull request on github soon, but meanwhile, feel free to
get it from here:

https://drive.google.com/drive/folders/1gxP9nSvv_wUxQcxLfOrGnrb30Jtf46I2?usp=sharing

And while we are at it of course I ran into troubles with the self-signed
cert, so I used one from letsecnrypt, but I fount letsencrypt a major pain
to use so this website helped me:

https://punchsalad.com/ssl-certificate-generator/

While I have seen plenty of scripts on github to get web2py play nice with
serving the static challenger file in .well-known/acme-challenge, I found
that too much fiddling for now so
I just opted for using the DNS check:

If you use godaddy here are some tipps:

When you add a DNS verfiy TXT record for letsencrypt drop the domain from
the TXT recrod displayed so it says :

_acme-challenge

instead of

_acme-challenge.yourdomain.com

because godaddy adds "yourdomain.com" automatically.

[image: image.png]

Also do not use the function to "route to another IP with masking" in
Godaddy if you want a working web2py,nginx, letsencrypt ssl hosting to
work, as it introduces another bounce inbetween.

You can download the key and cert bundle and then just replace and
web2py.cert and web2py.key file with the ones from letsencrypt and restart
nginx.

Instead deactivated any re-routing offered by godaddy and just remove the
current
A @ someip entry

and add

A @ yourserverip

instead.

Now the routing to your Linux host will work.

Last tipp that I find useful:

Oralce gives you 2 Linux VPS servers for free forever and 2 hosted Oracle
databases free forever:

https://www.oracle.com/cloud/free/

I am using it and I am pleased so far.
Another tipp:

Enable at least 4GB swap right away.
It does not have swap per default and only 1GB ram. So usually that leads
to problems without swap.
I also put swappiness = 10.

I had some struggles with IPtables and the Oracle firewall at the
beginning, but if you have troubles opening ports just let me know.

For example for opening port 443 you have to first enable an ingress rule
in Oracle Cloud to let the TCP traffic hit your VM and then within your
ubuntu VM you also need to open the port like so:

sudo iptables -I INPUT 2 -p tcp --dport 443 -j ACCEPT

So your HTTPS traffic comes through.


Am Mo., 31. Aug. 2020 um 17:23 Uhr schrieb Jim S :

> I believe it means that you're running http vs https and you're client is
> not running on the server (on a development machine for instance)
>
> To run Administration from a client other than the server host, you must
> use secure https protocol.
>
> Can someone please jump in if what I'm saying isn't correct?
>
> -Jim
>
> On Monday, August 31, 2020 at 10:13:06 AM UTC-5, Andrea Fae' wrote:
>>
>> Often when I try to modify a record through application it happens this
>> error:
>>
>> "amministrazione disabilitata: comunicazione non sicura"
>>
>> in english
>>
>> administration disabled: communication is insecure
>>
>> What does it means? What I have to do?
>> 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/bf4ac138-743b-490f-a9a3-2e38dc0390c9o%40googlegroups.com
> <https://groups.google.com/d/msgid/web2py/bf4ac138-743b-490f-a9a3-2e38dc0390c9o%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/CADHCKLSgho0JCquWWvsGOCvyiaARn%3DY-UZuioEiTSRbd%2BDDoPg%40mail.gmail.com.


[web2py] German Translation

2020-08-20 Thread Kevin Keller
I am currently updating web2pys German translation of the sample app.

Currently its a mix of German, Catalan and English.

Will push some updates soon, but thought to just already send a heads up.

-- 
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/CADHCKLSQ2HGPuR0tvqFusZntbTHkp_amy%3D5rp48U0Xxn_QBLdg%40mail.gmail.com.


[web2py] Updted Nginx+Ubuntu20.04+web2py script

2020-08-20 Thread Kevin Keller
Hey everyone,

I struggled last night to setup web2py on my VPS Linux server which uses
ubuntu 20.04.

I had to update the script with multiple edits.

Most of them around new pip syntax, updated requirements of nginx for
self-signed certs and updated package names.

I will create a pull request on github soon, but meanwhile, feel free to
get it from here:

https://drive.google.com/drive/folders/1gxP9nSvv_wUxQcxLfOrGnrb30Jtf46I2?usp=sharing

And while we are at it of course I ran into troubles with the self-signed
cert, so I used one from letsecnrypt, but I fount letsencrypt a major pain
to use so this website helped me:

https://punchsalad.com/ssl-certificate-generator/

While I have seen plenty of scripts on github to get web2py play nice with
serving the static challenger file in .well-known/acme-challenge, I found
that too much fiddling for now so
I just opted for using the DNS check:

If you use godaddy here are some tipps:

When you add a DNS verfiy TXT record for letsencrypt drop the domain from
the TXT recrod displayed so it says :

_acme-challenge

instead of

_acme-challenge.yourdomain.com

because godaddy adds "yourdomain.com" automatically.

[image: image.png]

Also do not use the function to "route to another IP with masking" in
Godaddy if you want a working web2py,nginx, letsencrypt ssl hosting to
work, as it introduces another bounce inbetween.

You can download the key and cert bundle and then just replace and
web2py.cert and web2py.key file with the ones from letsencrypt and restart
nginx.

Instead deactivated any re-routing offered by godaddy and just remove the
current
A @ someip entry

and add

A @ yourserverip

instead.

Now the routing to your Linux host will work.

Last tipp that I find useful:

Oralce gives you 2 Linux VPS servers for free forever and 2 hosted Oracle
databases free forever:

https://www.oracle.com/cloud/free/

I am using it and I am pleased so far.
Another tipp:

Enable at least 4GB swap right away.
It does not have swap per default and only 1GB ram. So usually that leads
to problems without swap.
I also put swappiness = 10.

I had some struggles with IPtables and the Oracle firewall at the
beginning, but if you have troubles opening ports just let me know.

For example for opening port 443 you have to first enable an ingress rule
in Oracle Cloud to let the TCP traffic hit your VM and then within your
ubuntu VM you also need to open the port like so:

sudo iptables -I INPUT 2 -p tcp --dport 443 -j ACCEPT

So your HTTPS traffic comes through.

-- 
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/CADHCKLT4m8tLtEHOwoFgoBPo1BFJNnURvqiE%3DiBNPMtySz1eog%40mail.gmail.com.


Re: [web2py] Re: modules: NameError("name 'reload' is not defined",)

2020-08-18 Thread Kevin Keller
I see there is an open issue on git from 8 days ago:

https://github.com/web2py/web2py/issues/2341

So just FYI it is already reported.

Its a strange error.

Must be somewhere in the module save function and after save it should
trigger the compile which obviously does not work anymore either.

Should be a small thing

Am Di., 18. Aug. 2020 um 15:56 Uhr schrieb xgp.l...@gmail.com <
xgp.lat...@gmail.com>:

> Hi,
>
> I already open a conversation about this but no complete answers were
> given.
> I ran from source and experience the same error.
>
>
> Cheers,
>
> El Tuesday, August 18, 2020 a la(s) 8:52:43 AM UTC-5, kell...@gmail.com
> escribió:
>
>> Same issue here with newest web2py
>>
>> Am Di., 18. Aug. 2020 um 07:08 Uhr schrieb 'Annet' via web2py-users <
>> web...@googlegroups.com>:
>>
>>> I reported the same problem some time ago.
>>>
>>> When I edit a module and save it I get this nameError. Since I am
>>> importing the modules into other applications I have to restart web2py
>>> everytime I edit a module.
>>>
>>> Further more the module are no longer compiled on first use, which
>>> I also find very annoying.
>>>
>>> Annet
>>>
>>> Op zondag 16 augustus 2020 om 12:09:28 UTC+2 schreef Vlad:
>>>
 same error, though with a lot more than 3 lines

 On Wednesday, June 24, 2020 at 5:36:36 AM UTC-5 serge.bo...@gmail.com
 wrote:

>
> I have an issue saving my modues with the last version of web2py.
> Is there something I do wrong?
>
> Context: Ubuntu 18.04 / web2py version 2.20.4 / python 3.6.9
>
> How to reproduce this issue (a bug??) with a simple example:
>
> In the applications examples, create a module (for instance empty.py)
>
> Then open it,
> => url:
> 127.0.0.1:8000/admin/default/edit/examples/modules/empty.py?id=modules__empty__py
> The file contains 3 lines:
> #!/usr/bin/env python
> # -*- coding: utf-8 -*-
> from gluon import *
>
> do not change anything and save it (ctrl + S)...
>
> => Since the last version, I get the following message:
>
>  Impossible de recharger le module car:
>  NameError("name 'reload' is not defined",)
>
> Thanks for any advise...
>
 --
>>> 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/56370ed0-27a0-4b3d-a984-2fd6ac7bb964n%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/df07ae0b-2ffa-453d-a481-363567f9b6f6n%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/CADHCKLQSg2MNzKE_OiVijJhJZDSG0z0qRtLxmT8%2BY%2Bq5Y4W0iA%40mail.gmail.com.


Re: [web2py] Re: modules: NameError("name 'reload' is not defined",)

2020-08-18 Thread Kevin Keller
Same issue here with newest web2py

Am Di., 18. Aug. 2020 um 07:08 Uhr schrieb 'Annet' via web2py-users <
web2py@googlegroups.com>:

> I reported the same problem some time ago.
>
> When I edit a module and save it I get this nameError. Since I am
> importing the modules into other applications I have to restart web2py
> everytime I edit a module.
>
> Further more the module are no longer compiled on first use, which
> I also find very annoying.
>
> Annet
>
> Op zondag 16 augustus 2020 om 12:09:28 UTC+2 schreef Vlad:
>
>> same error, though with a lot more than 3 lines
>>
>> On Wednesday, June 24, 2020 at 5:36:36 AM UTC-5 serge.bo...@gmail.com
>> wrote:
>>
>>>
>>> I have an issue saving my modues with the last version of web2py.
>>> Is there something I do wrong?
>>>
>>> Context: Ubuntu 18.04 / web2py version 2.20.4 / python 3.6.9
>>>
>>> How to reproduce this issue (a bug??) with a simple example:
>>>
>>> In the applications examples, create a module (for instance empty.py)
>>>
>>> Then open it,
>>> => url:
>>> 127.0.0.1:8000/admin/default/edit/examples/modules/empty.py?id=modules__empty__py
>>> The file contains 3 lines:
>>> #!/usr/bin/env python
>>> # -*- coding: utf-8 -*-
>>> from gluon import *
>>>
>>> do not change anything and save it (ctrl + S)...
>>>
>>> => Since the last version, I get the following message:
>>>
>>>  Impossible de recharger le module car:
>>>  NameError("name 'reload' is not defined",)
>>>
>>> Thanks for any advise...
>>>
>> --
> 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/56370ed0-27a0-4b3d-a984-2fd6ac7bb964n%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/CADHCKLSUHiqMRLuuMYH%3DXvCqUAoXijcuu%2BT3v%3Dvt8bymn1huig%40mail.gmail.com.


Re: [web2py] Re: Has anybody had experience with Visual Studio Code Remote Development?

2020-08-10 Thread Kevin Keller
Ok cool Andrew.

Really good to know.

Will give another try then.



On Tue, Aug 11, 2020, 02:20 AGRogers  wrote:

> Thanks Villas. That's encouraging.
>
> On Tue, 11 Aug 2020, 2:17 am villas,  wrote:
>
>> In the absence of other replies...
>>
>> Massimo has mentioned (in the py4web group)
>>  that
>> he knows generally that many developers are using Visual Studio remotely
>> and it is a very good set up, so he strongly recommends it.
>> This seems consistent with your experience so I suggest you should
>> continue to go with it.
>> I use VS locally with web2py and like it,  so I'm thinking to do the same.
>>
>>
>>
>> On Friday, 7 August 2020 06:45:16 UTC+1, AGRogers wrote:
>>>
>>> Hi
>>>
>>> Has anyone used this sort of config before with web2py? That is, VSC
>>> connecting via SSH to a remote server (Google Cloud Debian VM for me) and
>>> then being able to debug an app on the remote system.
>>>
>>> I am getting ready to deploy my app for the first time and have been
>>> somewhat fearful that if there is some weird bug I will never be able to
>>> track it down without being able to debug on that system.
>>>
>>> So i stumbled onto this
>>> https://code.visualstudio.com/docs/remote/remote-overview which seems
>>> really cool - you can run python apps on a remote server and debug it like
>>> it was on the localhost.
>>>
>>> So i got a Google Cloud server installed and got VSC talking to it fine
>>> and debugged a one line python 'app'. So that was neat.
>>>
>>> But I am not sure where to start with web2py in this environment. I
>>> havent tried very hard yet though.
>>>
>>> Can anyone tell me i am wasting my time or that it works great?
>>>
>>> Thanks
>>> Andrew
>>>
>> --
>> 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/68a5b9a0-368c-4d3c-990f-491190f98fbeo%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/CACWMBMM-7HsMEP9g854%2BoCuu8jfCZWvFo_rifSoTzXghY6ZNLg%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/CADHCKLR%3DTGsujPG5EEZBkWGs1DAL%3D75ukqAMVF%3DoTyP9nNHUyw%40mail.gmail.com.


Re: [web2py] Re: Has anybody had experience with Visual Studio Code Remote Development?

2020-08-10 Thread Kevin Keller
I tried to use it once remotely, not even web2py related, but there were
quite some hoops to jump through, as far I as remembered.

You have to add some custom code to your app to make communicate etc. and I
could not be bothered.

Anyways, I went back to just use vim with several plugins that make it a
nice VS Code type experience.

Happy to share the .vimrc file.

Am Mo., 10. Aug. 2020 um 18:17 Uhr schrieb villas :

> In the absence of other replies...
>
> Massimo has mentioned (in the py4web group)
>  that he
> knows generally that many developers are using Visual Studio remotely and
> it is a very good set up, so he strongly recommends it.
> This seems consistent with your experience so I suggest you should
> continue to go with it.
> I use VS locally with web2py and like it,  so I'm thinking to do the same.
>
>
>
> On Friday, 7 August 2020 06:45:16 UTC+1, AGRogers wrote:
>>
>> Hi
>>
>> Has anyone used this sort of config before with web2py? That is, VSC
>> connecting via SSH to a remote server (Google Cloud Debian VM for me) and
>> then being able to debug an app on the remote system.
>>
>> I am getting ready to deploy my app for the first time and have been
>> somewhat fearful that if there is some weird bug I will never be able to
>> track it down without being able to debug on that system.
>>
>> So i stumbled onto this
>> https://code.visualstudio.com/docs/remote/remote-overview which seems
>> really cool - you can run python apps on a remote server and debug it like
>> it was on the localhost.
>>
>> So i got a Google Cloud server installed and got VSC talking to it fine
>> and debugged a one line python 'app'. So that was neat.
>>
>> But I am not sure where to start with web2py in this environment. I
>> havent tried very hard yet though.
>>
>> Can anyone tell me i am wasting my time or that it works great?
>>
>> Thanks
>> Andrew
>>
> --
> 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/68a5b9a0-368c-4d3c-990f-491190f98fbeo%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/CADHCKLRh8Rd9vi2q9DRAudf9C5iPaa-pzzUhWLu83rsQ%3DHW%3DNg%40mail.gmail.com.


[web2py] Re: 2.19.1 redis sessions problem

2020-06-18 Thread Kevin Keller
Is there any update on this or will we not be able to use redis again? ;)

I see there is a redis pull request from last year too. 

On Saturday, 28 March 2020 11:30:11 UTC+1, Jose C wrote:
>
> Just started testing version 2.19.1 (prior to upgrading) with py3.6 and it 
> appears that when sessions are stored in redis, a new session is being 
> created each time the login is submitted which then prevents a session from 
> logging in.  
>
> This issue was discussed in 
> https://groups.google.com/forum/#!msg/web2py/z1ee025ghRU/qByNuEjGAgAJ  
> and Jim S found a workaround with the .decode function which worked on py3 
> but not on py2 (and which I've been using live).  It looks like the redis 
> session code has been refactored in 2.19.1 to remove all the decodes but I 
> can't get it to work correctly.
>
> Can anyone confirm whether they have this issue when trying to login using 
> redis sessions in 2.19.1 (with py3)?  If confirmed, I'll file a bug report.
>
> Thanks,
>
> Jose
>

-- 
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/70b9080b-f567-48c3-8a2c-466f65cd5165o%40googlegroups.com.


Re: [web2py] Re: RestAPI: how to restrict query results to data belonging to logged in user?

2020-05-27 Thread Kevin Keller
The "proper" way would be to define "scopes" in your application. Scopes
define who has access to which data.
You can also call it roles or tags or whatever.
Scopes is the term that is used by OAuth/OpenID connect, which is usually
used to secure APIs.

Normally you would get an OpenID (OIDC) ID Token as JWT when you login.
Once you have that you would read that tokens contents and look for the
scopes in the token and match those scopes with which the user shall access
your data.
Similiar to what you did here with the workaround to match the user.id to
the data.
I suppose you can extend this examlple/workaround to used custom auth
fields or the roles fields provided by web2py.

Some applications dont use scopes but so called claims from the JWT token.
Claims is extra info about a user such as first, lastname phonenumber etc.
that can be extracted from the token.
They put user roles in the tokens claims and match them with the
applications rest api against the database.
Similair to what you did.

But claims are not supposed to be used for that normally, that is what
scopes are for.
Claims are just used to "contextualize" a reqiest for the API i.e. fetch
relevant information for the requestor if the requestor is for example from
Europe fetch all infos for Europeans from the database,
if from another continent, fetch other data.

I have not seen Web2py used in this way, but there you go.
Just though this info may be interesting.

I found this example / workaorund super useful.

Will also use it :).

Seems to just get the job done quickly.





On Wed, May 27, 2020 at 6:18 PM Jacinto Parga  wrote:

> Hello,
>
> I used this workaround in a similar case:
>
> @auth.requires_login()
> @request.restful()
> def myapi():
> def GET():
> response.view = 'generic.json'
> myreg = db(db.mytable.created_by==auth.user.id).select() # Maybe
> in your case mytable.user_id==auth.user.id
> if myreg:
> return dict(myreg=myreg)
> else:
> data ='{"Result" : "Still empty"}'
> return data
> return dict(GET=GET)
>
>
>
> El sábado, 23 de mayo de 2020, 10:17:44 (UTC+2), Alexei Vinidiktov
> escribió:
>>
>> Hello,
>>
>> How can I restrict access via RestAPI for the user such that they can
>> only get their own records (those that have the field user_id matching
>> their user id)?
>>
>> For example, I have a a table named 'collections' that has a 'user_id'
>> field, and I want my users to get only the collections that they created.
>>
>> If they try to get someone else's collection, then they should get a 'not
>> authorized' response.
>>
>> As an extension, I would also like to allow for users to be able to get
>> someone else's collection if its status is equal to 'PUBLIC'.
>>
>> Here's the definition of my collections table:
>>
>> db.define_table('collections',
>> Field('user_id', db.auth_user, notnull=True),
>> Field('language_code', length="3", requires=IS_IN_DB(db, 'language.code',
>> db.language._format), notnull=True),
>> Field('title', length=512, notnull=True),
>> Field('description', 'text', notnull=False),
>> Field('privacy', length=50, requires=IS_IN_SET(privacy_set), notnull=True,
>> default='PRIVATE'),
>> Field('level',length=10, requires=IS_IN_SET(level_set), notnull=True,
>> default='NONE'))
>>
>> Thanks,
>>
>> --
>> Alexei
>>
> --
> 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/a01f1311-adfe-4b95-9200-14afe29c9e5b%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/CADHCKLSFWgpUxn1khMyow3U23ZeUi%2Byd9o%3Dk5d9WGc2syOhPJA%40mail.gmail.com.


Re: [web2py] Re: Credential (email) encryption

2020-05-22 Thread Kevin Keller
It shouldn't be hard to use hashes for usernames too, but there may be
complications later when it comes to storing user sessions and needing user
information in your session etc.

I think iy would br easier if you just encrypt the whole database and make
web2py read the encrypted data transparently.

You would need to check your database features and configuration for that
and also configure web2py to use the database key when connecting etc.



On Fri, 22 May 2020, 12:57 Kevin Keller,  wrote:

> Without having checked the code, i am pretty sure that the builtin Auth
> Modul of Web2py expects a plaintext email in the username field when
> checking the credentials.
>
> I suppose now it fails as the encrypted email value does simply not match
> the plaintext one.
>
> You would need to modify the Auth module to encrypt the plain text email
> after submitting and then also checking against an encrypted value. During
> user registration you would also need to insure user name encryption.
>
> This is in fact pretty much how passwords are stored, with a hash, so inr
> way encryption and only the hashes are compared.
>
>
>
> On Fri, 22 May 2020, 12:15 Michele Serra,  wrote:
>
>> Please answer!
>>
>> Il giorno martedì 21 aprile 2020 15:16:38 UTC+2, Michele Serra ha scritto:
>>>
>>> Anyone? please
>>>
>>> Il giorno venerdì 10 aprile 2020 12:38:02 UTC+2, Michele Serra ha
>>> scritto:
>>>>
>>>> Hi,
>>>> I use the email as the login credential, I tried to encrypt the email
>>>> with
>>>>
>>>> db.auth_user.email.filter_in = lambda value : secure_dumps(value,
>>>> enc_key)
>>>> db.auth_user.email.filter_out = lambda value : secure_loads(value,
>>>> enc_key)
>>>>
>>>> and it works well, in the database I see the encrypted data while from
>>>> the appadmin I see the decrypted data.
>>>>
>>>> But when I try to login it fails, with an "INVALID LOGIN"
>>>> Have you ever tried?
>>>> What am I doing wrong?
>>>>
>>> --
>> 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/1f196a71-6224-4ee3-988b-d130bd19c53a%40googlegroups.com
>> <https://groups.google.com/d/msgid/web2py/1f196a71-6224-4ee3-988b-d130bd19c53a%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/CADHCKLRYFY27EroXpa9jq9p48y8W2TqUWe7jS-o_osMv6zYCtg%40mail.gmail.com.


Re: [web2py] Re: Credential (email) encryption

2020-05-22 Thread Kevin Keller
Without having checked the code, i am pretty sure that the builtin Auth
Modul of Web2py expects a plaintext email in the username field when
checking the credentials.

I suppose now it fails as the encrypted email value does simply not match
the plaintext one.

You would need to modify the Auth module to encrypt the plain text email
after submitting and then also checking against an encrypted value. During
user registration you would also need to insure user name encryption.

This is in fact pretty much how passwords are stored, with a hash, so inr
way encryption and only the hashes are compared.



On Fri, 22 May 2020, 12:15 Michele Serra,  wrote:

> Please answer!
>
> Il giorno martedì 21 aprile 2020 15:16:38 UTC+2, Michele Serra ha scritto:
>>
>> Anyone? please
>>
>> Il giorno venerdì 10 aprile 2020 12:38:02 UTC+2, Michele Serra ha scritto:
>>>
>>> Hi,
>>> I use the email as the login credential, I tried to encrypt the email
>>> with
>>>
>>> db.auth_user.email.filter_in = lambda value : secure_dumps(value,
>>> enc_key)
>>> db.auth_user.email.filter_out = lambda value : secure_loads(value,
>>> enc_key)
>>>
>>> and it works well, in the database I see the encrypted data while from
>>> the appadmin I see the decrypted data.
>>>
>>> But when I try to login it fails, with an "INVALID LOGIN"
>>> Have you ever tried?
>>> What am I doing wrong?
>>>
>> --
> 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/1f196a71-6224-4ee3-988b-d130bd19c53a%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/CADHCKLQ6%3D%2BTng8%3DYjVrAvRroNp_p_Frh13PNZqp_7KpJP-7Eag%40mail.gmail.com.


Re: [web2py] Re: debian 10 : mysql Ver 8.0.19 f : mysql_secure_installation

2020-04-22 Thread Kevin Keller
I think there is an issue with web2py not supporting mysql version 8 and
above.



On Wed, 22 Apr 2020, 03:20 Jim S,  wrote:

> In your second post above you're connecting to mysql with user usertest
> and a password.
>
> In you web2py example you're connecting with user root.
>
> I'm guessing that is not the issue but can you confirm that you're using
> the same user and password connecting via mysql and via web2py?
>
> -Jim
>
> On Tuesday, April 21, 2020 at 7:59:52 PM UTC-5, L c wrote:
>>
>> no idea ?
>>
>> Le mercredi 22 avril 2020 02:12:43 UTC+2, L c a écrit :
>>>
>>> if i try to create a new app with that it does not work, why ?? i don't
>>> know first time it happens. mysql-server well installed , with sqlite it
>>> works fine ... i don't know what to do , thank you again for your help
>>>
>>> dbun = DAL('mysql://root:mypwd@localhost:3306/4test', pool_size=0)
>>> #dbun = DAL("sqlite://storage.sqlite")
>>> dbun.define_table('personnel',
>>> Field('login', type = 'string' , length = 25 ),
>>> Field('nom', type = 'string' , length = 20 ),
>>> migrate=True)
>>>
>>>
>>>
>>>
>>>
>>>
>>> Le mercredi 22 avril 2020 02:05:33 UTC+2, L c a écrit :

 No

 Le mercredi 22 avril 2020 01:41:39 UTC+2, Jim S a écrit :
>
> Is the DB on a separate server from the web application?
>
> Jim
>
>
> On Tue, Apr 21, 2020, 5:59 PM L c  wrote:
>
>> New server
>> same app
>> same credentials
>> thank you
>>
>>
>> Le mardi 21 avril 2020 22:04:43 UTC+2, Jim S a écrit :
>>>
>>> Is this all running on the same machine?
>>>
>>> I'm assuming you haven't changed your app at all, the database
>>> server is just new.  Correct?  Same credentials apply?
>>>
>>> -Jim
>>>
>>> On Tuesday, April 21, 2020 at 2:30:15 PM UTC-5, L c wrote:

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

 Le mardi 21 avril 2020 17:37:56 UTC+2, L c a écrit :
>
> Hello,
> I cannot access to a mysql database, il am sure the login/pwd are
> ok, tested on command line
> On my old sever it was ok, no pb and now impossible :(
> Have you an idea ?
> 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 a topic in
>> the Google Groups "web2py-users" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/web2py/EzI9i_62aSo/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to
>> web...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/web2py/93626f3b-6e42-4520-9cac-d24577798a3b%40googlegroups.com
>> 
>> .
>>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> 

Re: [web2py] Installation

2020-04-05 Thread Kevin Keller
Thanks for reporting this.

Maybe there is something wrong with the one click installer at the moment.

Just download the source version for normal users (py3) extract it and run
python3 web2py.py.

That should get you going.



On Sun, 5 Apr 2020, 12:20 David Swarbrick,  wrote:

> I also tried the alternative suggestion on the installation page of running
>
> python web2py.py
>
>  . . but there is of course no such file in the directory. There are
> plenty of .pyd files (what are they?), but no .py files.
>
> And again - many thanks
>
>
> On Sunday, 5 April 2020 11:08:30 UTC+1, David Swarbrick wrote:
>>
>> Many thanks
>>
>> That worked so that I could see the error message:
>>
>> Traceback (most recent call last):
>>   File "", line 6, in 
>>   File "__main__.py", line 128, in 
>>   File "__main__web2py__.py", line 33, in 
>> TypeError: start() takes no arguments (1 given)
>>
>>
>> David Swarbrick da...@swarb.co.uk - dsw...@gmail.com - swarb.co.uk Tel
>> 0795 457 9992 / +44(0)1484 380326
>>
>>
>>
>> On Sun, 5 Apr 2020 at 08:29, Val K  wrote:
>>
>>> Try run web2py.exe from cmd/shell to see an error
>>>
>>> --
>>> 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/607633b4-3628-4800-acdc-246350f6982b%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/320d8cca-881b-4b03-9d7a-6797b0f3b047%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/CADHCKLSu3Bh1SDCs7RVHBvCK0-kPDaiHXD%3DgBS37%3DE2kr_L1Eg%40mail.gmail.com.


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

2020-03-13 Thread Kevin Keller
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+'_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 <https://did.app/> 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 develo

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

2020-03-12 Thread Kevin Keller
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+'_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 <https://did.app/> 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)
>>>> ---
>&g

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

2020-03-12 Thread Kevin Keller
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+'_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 <https://did.app/> 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 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/CAEM0BxO8Gv%2BcJY-o_WXFEkEBMEFRA-WiPknUASOR7gXGzrKvAw%40mail.gmail.com
>>> <https://groups.google.com/d/msgid/web2py/CAEM0BxO8Gv%2BcJY-o_WXFEkEBMEFRA-WiPknUASOR7gXGzrKvAw%40mail.gmail.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 vie

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

2020-03-11 Thread Kevin Keller
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 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/CAEM0BxO8Gv%2BcJY-o_WXFEkEBMEFRA-WiPknUASOR7gXGzrKvAw%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/CADHCKLSOTzGdYe8UV7J%3DC4Pq_BU7ia61Z%2BHbJH2ryj%2BWTxS6ig%40mail.gmail.com.


Re: [web2py] Re: The PyDal/Yatl Web2Py/Py4web Emmet/Weppy Ecosystem

2020-02-27 Thread Kevin Keller
Hey Jim,

Weppy is now re-named to Emmet:

https://github.com/emmett-framework/emmett



On Thu, Feb 27, 2020 at 6:38 PM Jim S  wrote:

> Kevin
>
> I'm curious about your comment on Weppy/Emmet evolving.  Looks like there
> has been only 1 commit in the past 16 months or so (it is possible I'm
> reading that wrong).  What do you know about their progress.  Also, I'd
> love to be able to use PyDAL as classes as used in weppy (while not taking
> away the current capabilities).  That would be a great step forward.
>
> -Jim
>
> On Thursday, February 27, 2020 at 10:23:19 AM UTC-6, Kevin Keller wrote:
>>
>> I was thinking, just by how often I go back to Web2Py, what an excellent
>> framework it is and
>> the progress of Py4Web is also exciting, while also noticing how the
>> pydal/yatl based framework Weppy/Emmet is evolving,
>> that really there is no need anymore to think in terms of the future of a
>> single framework.
>>
>> I feel like Web2Py has evolved into its own family sort of like:
>>
>> Web2Py - the opinionated full stack low code enterprise framework
>> Py4Web - the api first flexible microframework with some batteries
>> included
>> Emmet/Weppy - the opinionated small scale framework
>>
>> I myself also used PyDal and Yatl with Flask which also worked nice.
>>
>> I feel like the PyDal/Yatl combination has evolved into its own ecosystem
>> that can share a great deal of code
>> you can easily switch from one to the other depending on your use case
>> and can happily co-exist.. no?
>>
>> Almost felt like finding a name for the PyDal/Yatl based type of
>> frameworks which contrast the Django/ORM and SQLAlchemy/Almembic world of
>> frameworks
>> and shine through ease of use compared to those.
>>
>>
>> --
> 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/88f6bbdf-770d-4752-ae5a-c688567e1dcf%40googlegroups.com
> <https://groups.google.com/d/msgid/web2py/88f6bbdf-770d-4752-ae5a-c688567e1dcf%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/CADHCKLR7Fc9pA9J07Ckk2FgSs_C25Q6ixChxHU946XETCRpLnQ%40mail.gmail.com.


[web2py] The PyDal/Yatl Web2Py/Py4web Emmet/Weppy Ecosystem

2020-02-27 Thread Kevin Keller
I was thinking, just by how often I go back to Web2Py, what an excellent 
framework it is and
the progress of Py4Web is also exciting, while also noticing how the 
pydal/yatl based framework Weppy/Emmet is evolving, 
that really there is no need anymore to think in terms of the future of a 
single framework. 

I feel like Web2Py has evolved into its own family sort of like: 

Web2Py - the opinionated full stack low code enterprise framework
Py4Web - the api first flexible microframework with some batteries included
Emmet/Weppy - the opinionated small scale framework

I myself also used PyDal and Yatl with Flask which also worked nice. 

I feel like the PyDal/Yatl combination has evolved into its own ecosystem 
that can share a great deal of code
you can easily switch from one to the other depending on your use case and 
can happily co-exist.. no? 

Almost felt like finding a name for the PyDal/Yatl based type of frameworks 
which contrast the Django/ORM and SQLAlchemy/Almembic world of frameworks 
and shine through ease of use compared to those. 


-- 
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/72d1d3fe-fbc4-4011-a13c-ed8b6c4f2071%40googlegroups.com.


[web2py] Py4Web "tags" should be SCOPES

2020-02-24 Thread Kevin Keller
Hey, 

I would like to suggest, that if Py4Web is supposed to be an API first 
framework that it adheres to 
modern auth standards right out of the gate. 

Apart from having the ability to provide JWT access tokens and more Oauth2 
plugins then just facebook and google ( all things I started to work on)
I think we need to to think in terms of scopes when it comes to access 
management instead of "tags" for access authorization. 

It is pretty much the same thing, but using the the term scopes and 
adhering to the oauth2 terms and philosophy will make it 
easier for programmers to understand how to secure APIs created with py4web 
faster. 

We also need to the ability to properly parse JWT tokens so that scopes 
included in the token can be matched to what is now called py4web "tags" 
for data authorization. Also, we should be easily able to validate JWT 
tokens offline.

Plus py4web, if it wants to play the API game, needs to be able to extract 
claims from a JWT token in order to contextualize an API call easily. 

I think I have my work cut out for me, but just putting it out there, in 
the hope I can garner some support and understanding for this idea/approach
and maybe someone wants to also help out with this who understands API 
design and OIDC/Oauth2. 

Maybe we can use some library the is there i.e.:

https://requests-oauthlib.readthedocs.io/en/latest/index.html

and if want to mint our own JWT tokens for prototyping:

https://github.com/Refinitiv/bottle-oauthlib

I ll look into that, unless you have a better idea. 




-- 
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/3a8a0f6a-f64e-4941-892b-9adfaac8216a%40googlegroups.com.


Re: [web2py] py4web jwt ?

2020-02-20 Thread Kevin Keller
With a Spa the routing is done in Javascript in the Browser.

So Javascript or Vue / React etc need. To check if the user has a access or
id_token and if not redirect to the login page to obtain it.

Doing crud and be able to secure those crud rest routes will be critical
for productivity.

So we need a simple jwt token minting engine that at least can spit out a
access token for prototyping and and easy way to switch over to other IAM
solutions with py4web for production that can do the token minting.

That is something I am currently working on the whole oidc auth part make
it easy and I also want to make it available for web2py.

I have updated and got the oauth2 login provider working with Okta
yesterday and web2py.

Will share this. Code asap and sent a push to git to have that provider
updated and at some providers for different IAM solutions for both web2py
and py4web going forward.

Will try to share an example with py4web asap once I have something
working.

Will probaly be on the. Weekend.






On Thu, 20 Feb 2020, 10:42 Val K,  wrote:

> check request.content_type - is that 'application/json' ?
>
> On Thursday, February 20, 2020 at 9:28:43 PM UTC+3, Ramos wrote:
>>
>> getting this from py4web as an api.
>> [image: image.png]
>> Is not what i would like to see from a SPA standpoint.
>>
>> Regards
>> António
>>
>>
>> Em qui., 20 de fev. de 2020 às 18:03, Val K  escreveu:
>>
>>> It seems it depends on request.content_type
>>>
>>> https://github.com/web2py/py4web/blob/e6b3d5e10e15976af153c4a4e6b349a02fe6c2a9/py4web/utils/auth.py#L35
>>>
>>> --
>>> 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/9608a9ab-d338-4580-9d02-31b9b9a30782%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/77ac539d-a83e-4931-ae79-424c3a4711fd%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/CADHCKLTo0Dd0ttzt71c9-ALME%2BeYS0-JkX6nV641eOCbTH780g%40mail.gmail.com.


[web2py] Re: Expose db.auth_user table via rest api

2020-02-18 Thread Kevin Keller

Found the answer here:

https://stackoverflow.com/questions/37806801/can-not-post-data-via-ajax-to-web2py-rest-api-possible-cors-issue

def api():
 *from gluon.serializers import json*
 response.view = 'generic.'+request.extension
 def GET(*args,**vars):
  patterns = 'auto'
  parser = db.parse_as_rest(patterns,args,vars)
  if parser.status == 200:
 return dict(content=parser.response)
  else:
 raise HTTP(parser.status,parser.error)
 def POST(table_name,**vars):
 #return db[table_name].validate_and_insert(**vars)
 #data = gluon.contrib.simplejson.loads(request.body.read())
 *return json(db[table_name].validate_and_insert(**vars))*
 return dict()
 def PUT(table_name,record_id,**vars):
 return db(db[table_name]._id==record_id).update(**vars)
 def DELETE(table_name,record_id):
 return db(db[table_name]._id==record_id).delete()
 def OPTIONS(*args,**vars):
 print "OPTION called"
 return True
 return dict(GET=GET,POST=POST,PUT=PUT,DELETE=DELETE,OPTIONS=OPTIONS)

On Tuesday, 18 February 2020 11:47:22 UTC-8, Kevin Keller wrote:
>
> I didnt know I need to post the data as form data. 
>
> Now it works. 
>
> How I can post a JSON payload instead and use that payload for 
> insert_and_validate? 
>
> I tried this:
>
> def POST(table_name,**vars):
> import json
> data=json.loads(request.body.read())
> data=json.dumps(data)
> return dict(db[table_name].validate_and_insert(data))
>
> On Tuesday, 18 February 2020 11:02:20 UTC-8, Kevin Keller wrote:
>>
>> Even when  I manually try to convert the post data I get the error:
>>
>> def POST(table_name,**vars):
>> restdata=request.vars
>> 
>> return 
>> dict(db[table_name].validate_and_insert(restdata.decode("utf-8")))
>> 
>>
>> On Tuesday, 18 February 2020 10:01:14 UTC-8, Kevin Keller wrote:
>>>
>>> When creating a simple rest api with web2py:
>>>
>>> @request.restful()
>>> def api():
>>> 
>>> def GET(*args, **vars):
>>> parser=db.parse_as_rest('auto',args,vars)
>>> return dict(content=parser.response)
>>> 
>>> def POST(table_name,**vars):
>>> return dict(db[table_name].validate_and_insert(**vars))
>>> 
>>> return locals()
>>>
>>> I can get access via rest api to any table but auth_users.
>>>
>>> Is there a way I can enable this? 
>>>
>>> I would like to provision new users via rest api to my web2py app. 
>>>
>>> Authentication is done via external IDP via OIDC. 
>>>
>>> So I basically just need the firstname, lastname and email to be 
>>> provisioned via rest. 
>>>
>>> Authentication to provision is at the moment an after thought. 
>>>
>>> I just need to get this working asap. 
>>>
>>> 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/9dca454e-fdc6-47b2-aecb-10b7073b2467%40googlegroups.com.


[web2py] Re: Expose db.auth_user table via rest api

2020-02-18 Thread Kevin Keller
I didnt know I need to post the data as form data. 

Now it works. 

How I can post a JSON payload instead and use that payload for 
insert_and_validate? 

I tried this:

def POST(table_name,**vars):
import json
data=json.loads(request.body.read())
data=json.dumps(data)
return dict(db[table_name].validate_and_insert(data))

On Tuesday, 18 February 2020 11:02:20 UTC-8, Kevin Keller wrote:
>
> Even when  I manually try to convert the post data I get the error:
>
> def POST(table_name,**vars):
> restdata=request.vars
> 
> return 
> dict(db[table_name].validate_and_insert(restdata.decode("utf-8")))
> 
>
> On Tuesday, 18 February 2020 10:01:14 UTC-8, Kevin Keller wrote:
>>
>> When creating a simple rest api with web2py:
>>
>> @request.restful()
>> def api():
>> 
>> def GET(*args, **vars):
>> parser=db.parse_as_rest('auto',args,vars)
>> return dict(content=parser.response)
>> 
>> def POST(table_name,**vars):
>> return dict(db[table_name].validate_and_insert(**vars))
>> 
>> return locals()
>>
>> I can get access via rest api to any table but auth_users.
>>
>> Is there a way I can enable this? 
>>
>> I would like to provision new users via rest api to my web2py app. 
>>
>> Authentication is done via external IDP via OIDC. 
>>
>> So I basically just need the firstname, lastname and email to be 
>> provisioned via rest. 
>>
>> Authentication to provision is at the moment an after thought. 
>>
>> I just need to get this working asap. 
>>
>> 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/f3f2ffa7-8529-4d12-bfa6-7d66d96ca56a%40googlegroups.com.


[web2py] Re: Expose db.auth_user table via rest api

2020-02-18 Thread Kevin Keller
Even when  I manually try to convert the post data I get the error:

def POST(table_name,**vars):
restdata=request.vars

return 
dict(db[table_name].validate_and_insert(restdata.decode("utf-8")))


On Tuesday, 18 February 2020 10:01:14 UTC-8, Kevin Keller wrote:
>
> When creating a simple rest api with web2py:
>
> @request.restful()
> def api():
> 
> def GET(*args, **vars):
> parser=db.parse_as_rest('auto',args,vars)
> return dict(content=parser.response)
> 
> def POST(table_name,**vars):
> return dict(db[table_name].validate_and_insert(**vars))
> 
> return locals()
>
> I can get access via rest api to any table but auth_users.
>
> Is there a way I can enable this? 
>
> I would like to provision new users via rest api to my web2py app. 
>
> Authentication is done via external IDP via OIDC. 
>
> So I basically just need the firstname, lastname and email to be 
> provisioned via rest. 
>
> Authentication to provision is at the moment an after thought. 
>
> I just need to get this working asap. 
>
> 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/11f22b98-0fc9-4eab-9f43-7b149d640963%40googlegroups.com.


[web2py] Re: Expose db.auth_user table via rest api

2020-02-18 Thread Kevin Keller
I tried a custom pattern with the get method, but still dont get the users 
from auth_user


@request.restful()
def api():

def GET(*args, **vars):
patterns = [
"/users[auth_user]"
]
parser=db.parse_as_rest(patterns,args,vars)
return dict(content=parser.response)

def POST(table_name,**vars):
return dict(db[table_name].validate_and_insert(**vars))

return locals()


On Tuesday, 18 February 2020 10:01:14 UTC-8, Kevin Keller wrote:
>
> When creating a simple rest api with web2py:
>
> @request.restful()
> def api():
> 
> def GET(*args, **vars):
> parser=db.parse_as_rest('auto',args,vars)
> return dict(content=parser.response)
> 
> def POST(table_name,**vars):
> return dict(db[table_name].validate_and_insert(**vars))
> 
> return locals()
>
> I can get access via rest api to any table but auth_users.
>
> Is there a way I can enable this? 
>
> I would like to provision new users via rest api to my web2py app. 
>
> Authentication is done via external IDP via OIDC. 
>
> So I basically just need the firstname, lastname and email to be 
> provisioned via rest. 
>
> Authentication to provision is at the moment an after thought. 
>
> I just need to get this working asap. 
>
> 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/b2b4c86e-89f1-4639-a9af-104a01f87776%40googlegroups.com.


[web2py] Expose db.auth_user table via rest api

2020-02-18 Thread Kevin Keller
When creating a simple rest api with web2py:

@request.restful()
def api():

def GET(*args, **vars):
parser=db.parse_as_rest('auto',args,vars)
return dict(content=parser.response)

def POST(table_name,**vars):
return dict(db[table_name].validate_and_insert(**vars))

return locals()

I can get access via rest api to any table but auth_users.

Is there a way I can enable this? 

I would like to provision new users via rest api to my web2py app. 

Authentication is done via external IDP via OIDC. 

So I basically just need the firstname, lastname and email to be 
provisioned via rest. 

Authentication to provision is at the moment an after thought. 

I just need to get this working asap. 

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/0bc09844-ea05-4ecc-806f-ebede51e80f0%40googlegroups.com.


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

2020-02-13 Thread Kevin Keller
Being self contained, simple and with smartgrid, integrated Auth, and even
wiki engine and now again with updated pyrtf web2py could still have great
future as a a framework for company internal web database apps (also easy
field calculations) to replace I. E. Lotus notes or ms access apps and
internal processes via forms and knowledge management for citizen
developers.

Also speed is not so important for this apps.

While py4web is a fast open API first backend framework for modern SPAs and
mobile apps. I would use this for thst use cases plus any customer facing
or SaaS app.

Both frameworks could be used for equal use cases, but that is how I
currently see their sweet spots when compared.



On Wed, 12 Feb 2020, 22:35 Dave S,  wrote:

>
>
> On Wednesday, February 12, 2020 at 12:02:10 PM UTC-8, Vlad wrote:
>>
>> I've used web2py happily until today, but seems need to switch to py4web
>> :)
>>
>> I've never looked into py4web; just saw msgs going back and forth about
>> it.
>>
>> What's the best way to start? Any tutorials? Is there a book similar to
>> the one on web2py? What's the home page (assuming it's separate from web2py
>> itself)?
>>
>
> From those other messages:
> http://py4web.com/_documentation/static/index.html>
>
> /dps
>
>
>
>> On Monday, February 10, 2020 at 11:13:56 AM UTC-5, Massimo Di Pierro
>> wrote:
>>>
>>> Hello Victor,
>>>
>>> I recommend everybody to move from web2py to py4web. I am using the
>>> latter for my own projects and find it better.
>>> Honestly web2py has more features and it has been battle-tested but
>>> py4web is catching up quickly and, if you do not need the grid, I think it
>>> is already better.
>>>
>>> Massimo
>>>
>>>
>>>
>>> On Sunday, 9 February 2020 21:58:26 UTC-8, VJ Sosa wrote:

 Dear Massimo,

 One month ago I just started to develop some demos of a web application
 using web2py. I'm interested in go further with a more serious
 implementation,
 but today I'm realizing that this group is also talking about py4web.
 Considering that py4web is your new bet for a python framework, do you
 recommend me to go further with py4web instead of web2py?
 Will be web2py deprecated in a close future?
 Are you planning offer similar documentation (like a book) for py4web?

 Thanks in advance, I do appreciate your work.
 Víctor.

 El jueves, 30 de enero de 2020, 7:10:45 (UTC+1), Massimo Di Pierro
 escribió:
>
> Yes. for me it is the future. It is usable. I recently tried to port
> some of my apps from web2py to py4wb and f they do not use grid, the
> transition is almost trivial. The code ends up cleaner and you can use
> pylint and other tools to find errors. Converting complex Auth logic can 
> be
> tricky.
>
> On Wednesday, 22 January 2020 08:12:04 UTC-8, Hugo Alberto Rivera Diaz
> wrote:
>>
>> Massimo,an honor to salute you! One question so you would recommend
>> the use of py4web over web2py? Is py4web te next step for web2py 
>> developers?
>>
>> El mié., 22 ene. 2020 a las 0:23, Massimo Di Pierro (<
>> massimo...@gmail.com>) escribió:
>>
>>> I strongly recommend py4web + vue.js :-)
>>>
>>> On Tuesday, 21 January 2020 07:40:18 UTC-8, Ivan Gazzola wrote:
>>>
 We are a small company in Italy, we need a new developer for our
 project (xortho.it)

 The web app is developed with jquery mobile and web2py, we are
 planning to move to angular and web2py or better py4web.

 If you're interested please contact us.

 Ciao

 Ivan

 --
>>> Resources:
>>> - http://web2py.com
>>> - http://web2py.com/book (Documentation)
>>> - http://github.com/web2py/web2py (Source code)
>>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>>> ---
>>> You received this message because you are subscribed to the Google
>>> Groups "web2py-users" group.
>>> To unsubscribe from this group and stop receiving emails from it,
>>> send an email to web...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/web2py/fc6ea910-acbb-45b7-9553-2e33152d2863%40googlegroups.com
>>> 
>>> .
>>>
>>
>>
>> --
>>   * Saludos!*
>>*Hugo Alberto Rivera Diaz* 
>>
>>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> 

Re: [web2py] py4wb simplification

2020-02-02 Thread Kevin Keller
Happy to support with the oidc/oauth2.

Will share some code suggestions if that's ok with you

On Mon, 3 Feb 2020, 05:56 Massimo Di Pierro, 
wrote:

> mtable is in scope and usable. Does not supprt yet fields of
> list: type.
>
> Do not have a simple answer about OIDC/Oauth2 but I will try do it and
> post findings. :-)
>
> On Sunday, 2 February 2020 03:43:40 UTC-8, Kevin Keller wrote:
>>
>> Hey,
>>
>> Regarding the now code .
>>
>> I think its awesome.
>>
>> Immediate question is though, how I could replace py4web build in auth
>> with an outside IDM using OIDC/Oauth2?
>> I understand since Py4web is so modular now, I can figure it out myself
>> with 3rd party components.
>> But I think it would be a common use case and it would be great to just
>> be able to define an external auth server, client secret and id and secret
>> in a json file and just use
>> the build in py4web decorators no?
>>
>> Apart from that, unrelated to this, just to confirm.. mtable is gone or
>> is it still usable.. in scope going forward?
>>
>> Thanks!
>>
>>
>>
>> On Sat, Feb 1, 2020 at 5:55 AM Massimo Di Pierro <
>> massimo.dipie...@gmail.com> wrote:
>>
>>> I committed some new code to py4web
>>>
>>> Now you can do:
>>>
>>> from . common import authenticated, unauthenticated # from latest
>>> _scaffold
>>>
>>> # exposes index as /{app_name}/index and uses index.html or generic.html
>>> template, auth.user, db, T, session
>>> @authenticated()
>>> def index():
>>>   return dict()
>>>
>>> # GET only
>>> @authenticated.get()
>>> def index():
>>>   return dict()
>>>
>>> # exposes /{app_name}/index///
>>> @authenticated.get()
>>> def index(a,b,c):
>>>   return dict()
>>>
>>> # more explicit
>>> @authenticated.get("index///)
>>> def index(a,b,c):
>>>   return dict()
>>>
>>> Some magic
>>>
>>> # define a button that make the following serverside POST callback
>>> @unauthenticated.button("click me")
>>> def a_button(msg):
>>> print("you clicked the button and server received:", msg)
>>>
>>> # expose a page that displays the button which - onclick - makes the
>>> ballback
>>> @unauthenticated.get()
>>> def show_a_button():
>>> return dict(mybutton = a_button(msg="hello world"))
>>>
>>> Thoughts? Should we keep this API? Can we improve it?
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> --
>>> Resources:
>>> - http://web2py.com
>>> - http://web2py.com/book (Documentation)
>>> - http://github.com/web2py/web2py (Source code)
>>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>>> ---
>>> You received this message because you are subscribed to the Google
>>> Groups "web2py-users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to web2py+unsubscr...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/web2py/9261e53e-d45b-4be1-82e8-2d19a488df78%40googlegroups.com
>>> <https://groups.google.com/d/msgid/web2py/9261e53e-d45b-4be1-82e8-2d19a488df78%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/319c1f7d-7422-48e5-9cda-df141e2482e8%40googlegroups.com
> <https://groups.google.com/d/msgid/web2py/319c1f7d-7422-48e5-9cda-df141e2482e8%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/CADHCKLSMT58ZPj3bGVDNCjq6CPm7x4AteHHj3DNujWs26wyE7Q%40mail.gmail.com.


Re: [web2py] py4wb simplification

2020-02-02 Thread Kevin Keller
Hey,

Regarding the now code .

I think its awesome.

Immediate question is though, how I could replace py4web build in auth with
an outside IDM using OIDC/Oauth2?
I understand since Py4web is so modular now, I can figure it out myself
with 3rd party components.
But I think it would be a common use case and it would be great to just be
able to define an external auth server, client secret and id and secret in
a json file and just use
the build in py4web decorators no?

Apart from that, unrelated to this, just to confirm.. mtable is gone or is
it still usable.. in scope going forward?

Thanks!



On Sat, Feb 1, 2020 at 5:55 AM Massimo Di Pierro 
wrote:

> I committed some new code to py4web
>
> Now you can do:
>
> from . common import authenticated, unauthenticated # from latest _scaffold
>
> # exposes index as /{app_name}/index and uses index.html or generic.html
> template, auth.user, db, T, session
> @authenticated()
> def index():
>   return dict()
>
> # GET only
> @authenticated.get()
> def index():
>   return dict()
>
> # exposes /{app_name}/index///
> @authenticated.get()
> def index(a,b,c):
>   return dict()
>
> # more explicit
> @authenticated.get("index///)
> def index(a,b,c):
>   return dict()
>
> Some magic
>
> # define a button that make the following serverside POST callback
> @unauthenticated.button("click me")
> def a_button(msg):
> print("you clicked the button and server received:", msg)
>
> # expose a page that displays the button which - onclick - makes the
> ballback
> @unauthenticated.get()
> def show_a_button():
> return dict(mybutton = a_button(msg="hello world"))
>
> Thoughts? Should we keep this API? Can we improve it?
>
>
>
>
>
>
>
>
>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/web2py/9261e53e-d45b-4be1-82e8-2d19a488df78%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/CADHCKLQ33OtigmG%2BdYChqZ6_6HPE3Qiia3ySqQbzxfrBgoNCsQ%40mail.gmail.com.


Re: [web2py] Re: Web2py or py4web for a brand new project

2020-01-23 Thread Kevin Keller
I havent looked at py4web so far, because I dont get how it does permission
in general.

Is there an easy way to use JWT tokens and OIDC/OAUTH2 with Vue.js easily?

I think its quite a pain to go through this in general.
This is why I really liked about rendered HTML page apps.

If its not a complex app for a long term project I lied the OOTB auth and
crud mechanism.

Making every app a SPA app now I have to deal with REST payloads,
seriazlzing, de-serializing, JWT tokens, OAUTH/OIDC etc.
And for my apps I dont need the increase in loading times or less calls to
the back end so much.

But maybe there are ways to make this simple as well with py4web and
vue.js.





On Thu, Jan 23, 2020 at 5:02 PM Lovedie JC  wrote:

> Is there a problem with @auth_has _permission?
> I intend to use it.
> Regards
>
> On Thu, Jan 23, 2020, 18:57 Jim S  wrote:
>
>> You'll be fine with the new system I believe as long as you're not
>> currently using @auth.has_permission.  While you can do it with py4web it
>> is more challenging than in web2py.
>>
>> -Jim
>>
>> On Thursday, January 23, 2020 at 9:47:43 AM UTC-6, Christian Varas wrote:
>>>
>>> Hi Jim.
>>>
>>> Yes I'm using the auth system permission.
>>> I'm using 2 decorators in fact
>>> @auth.requires_membership() and @auth.requires_login()
>>>
>>> I'm gonna port my app to py4web then :)
>>>
>>> Thanks
>>>
>>> Cheers.
>>> Chris
>>>
>>> El jue., 23 de ene. de 2020 11:27, Jim Steil 
>>> escribió:
>>>
>>>> Sounds like a great app to do in py4web.
>>>>
>>>>1. You are already comfortable with javascript.
>>>>2. You're not using grid/smartgrid.
>>>>3. Are you using the web2py auth system with permissions?  If only
>>>>using groups (roles) then this would be great to do with py4web.
>>>>4. Much faster and you get to use Python3.
>>>>
>>>> -Jim
>>>>
>>>>
>>>> On Thu, Jan 23, 2020 at 6:44 AM Christian Varas 
>>>> wrote:
>>>>
>>>>> Thanks for all that you share guys.
>>>>>
>>>>> I would like to ask for a recommendation.
>>>>>
>>>>> I have a web interface made with web2py, this interface manage a web
>>>>> application firewall (nginx and modsecurity). It does commands and file
>>>>> modifications in the system to manage properly the WAF, the database is
>>>>> SQLite.
>>>>> I don't use sqlform.grid, most of the things in the view are made with
>>>>> pure JavaScript and Html, and all the commands to the system are with
>>>>> subprocess.
>>>>> Works pretty fast and without any issue.
>>>>>
>>>>> My question is if py4web is ok to do this tasks too, like editing
>>>>> files in system, executing commands and task more oriented to the system
>>>>> and not to a db.
>>>>>
>>>>>
>>>>> Now I have to a small adpatation to my app because modsecurity has a
>>>>> new version and they changed some things, and I was thinking that maybe I
>>>>> can port all to py4web and have a fresh new start, but I'm not sure..., I
>>>>> love web2py and now is easy to me to do things with him.
>>>>>
>>>>> Should I stay in web2py?
>>>>> Or I should start using py4web for this kind of project?
>>>>>
>>>>> Cheers!
>>>>> Chris.
>>>>>
>>>>>
>>>>> El mié., 22 de ene. de 2020 20:29, Carlos Costa 
>>>>> escribió:
>>>>>
>>>>>> Thanks for sharing you experience with py4web, Jim.
>>>>>>
>>>>>>
>>>>>> Em qua., 22 de jan. de 2020 às 20:04, Kevin Keller 
>>>>>> escreveu:
>>>>>>
>>>>>>> The datatables integration for web2py would be super useful. I'm
>>>>>>> sure we could port it over to py4web easily.
>>>>>>>
>>>>>>> I just feel like with all the stuff web2py gave us to get something
>>>>>>> quickly going missing, it'd just another api framework and there are
>>>>>>> fastapi and apistar as well falcon out..
>>>>>>>
>>>>>>> I think having these ease of use stuff back would really hit home
>>>>>>> and would also make it easier to port from web2py.
>>>

Re: [web2py] Re: Web2py or py4web for a brand new project

2020-01-22 Thread Kevin Keller
The datatables integration for web2py would be super useful. I'm sure we
could port it over to py4web easily.

I just feel like with all the stuff web2py gave us to get something quickly
going missing, it'd just another api framework and there are fastapi and
apistar as well falcon out..

I think having these ease of use stuff back would really hit home and would
also make it easier to port from web2py.

And we would be pretty much the Jhipster  of the python world no?



On Wed, 22 Jan 2020, 23:50 Jim S,  wrote:

> Yes, I will post my main utils.py when I have it working better.  I still
> have to clean up a couple pieces.  It would be up to Massimo if he wanted
> to add it.  But in response to one of my earlier questions I was told
> Massimo kept a utility like this out of py4web so people might use better
> tools like datatables.  And, I doubt my code is 'framework-ready'.  But it
> could give others insight into how you can work with py4web.
>
> Speaking of datatables, I wrote a datatables integration for web2py last
> summer.  I think I could also add that to my utils.py pretty easily.
> Actually, the datatables piece would be easier that what I've done writing
> my own.  Would you use datatables for complete CRUD, or just to list your
> table for record selection, etc.?
>
> Now that you mentioned mtable, I too recall hearing that before, but
> haven't gotten in to it at all.  Like I said, I haven't jumped in to the
> client-side javascript much yet, other than jquery.
>
> -Jim
>
> On Wednesday, January 22, 2020 at 4:31:11 PM UTC-6, Kevin Keller wrote:
>>
>> Jim,
>>
>> Could your helpers be considered to be added to thr py4web code base?
>>
>> If you say you have a sqlform.grid equivalent or something in that
>> direction?
>>
>> I think there was mtable that should take the spot, but haven't seen any
>> examples yet or at least none thst would replace a sqlform or smartgrid.
>>
>> If it is not coming I would probaly consider using datatables js in the
>> future.
>>
>>
>>
>>
>> On Wed, 22 Jan 2020, 21:47 Jim S,  wrote:
>>
>>> For me, there is no porting, it is re-writing.  While a lot of the
>>> capabilities are there in py4web not all are part of py4web.  Due to the
>>> nature of how things work, a lot of the 'global' structures in web2py have
>>> to be handled differently in py4web.
>>>
>>> SQLFORM.grid is gone.  FORM replaces SQLFORM but doesn't have all the
>>> features -
>>> https://py4web.com/_documentation/static/index.html#chapter-10
>>> auth_group and auth_membership and auth_permission are gone -
>>> authentication/authorization have changed -
>>> https://py4web.com/_documentation/static/index.html#chapter-11
>>>
>>> With those things being what they are, I've been playing with py4web for
>>> a few days now and really am liking it.  It is crazy fast.  You may have to
>>> write some more helpers to do some things that web2py did for you, but
>>> that's half the fun, isn't it?  For instance, I used the grid that web2py's
>>> SQLFORM.grid provides for lots of listing pages.  py4web doesn't have one
>>> so I've written a helper that displays  pages the way my app wants to see
>>> them.
>>>
>>> I believe py4web is going to make it easier to use Vue.js in your pages,
>>> but I haven't made the just to using Vue yet so I can't really comment on
>>> that part.
>>>
>>> -Jim
>>>
>>> On Wednesday, January 22, 2020 at 12:33:10 PM UTC-6, Carlos Costa wrote:
>>>>
>>>> Hey Massimo, thanks for the great info.
>>>>
>>>> How about porting apps from web2py to py4web?
>>>>
>>>> What steps would you recommend?
>>>>
>>>> Em qua., 22 de jan. de 2020 às 08:21, AGRogers 
>>>> escreveu:
>>>>
>>>>> OK, thanks. Re reporting errors, I suspect most errors will be due to
>>>>> my ignorance. But thanks for the encouragement.
>>>>>
>>>>> On Tue, Jan 21, 2020, 1:26 PM Massimo Di Pierro 
>>>>> wrote:
>>>>>
>>>>>> You should use the py4web documentation. Also please report any error
>>>>>> you find.
>>>>>>
>>>>>>
>>>>>> On Tuesday, 14 January 2020 22:03:59 UTC-8, Andrew Rogers wrote:
>>>>>>>
>>>>>>> Hi
>>>>>>>
>>>>>>> Is  the documentation for web2py still mostly relevant for py4web?
>>>>>>>
>>>>>>>

Re: [web2py] Re: Web2py or py4web for a brand new project

2020-01-22 Thread Kevin Keller
Jim,

Could your helpers be considered to be added to thr py4web code base?

If you say you have a sqlform.grid equivalent or something in that
direction?

I think there was mtable that should take the spot, but haven't seen any
examples yet or at least none thst would replace a sqlform or smartgrid.

If it is not coming I would probaly consider using datatables js in the
future.




On Wed, 22 Jan 2020, 21:47 Jim S,  wrote:

> For me, there is no porting, it is re-writing.  While a lot of the
> capabilities are there in py4web not all are part of py4web.  Due to the
> nature of how things work, a lot of the 'global' structures in web2py have
> to be handled differently in py4web.
>
> SQLFORM.grid is gone.  FORM replaces SQLFORM but doesn't have all the
> features - https://py4web.com/_documentation/static/index.html#chapter-10
> auth_group and auth_membership and auth_permission are gone -
> authentication/authorization have changed -
> https://py4web.com/_documentation/static/index.html#chapter-11
>
> With those things being what they are, I've been playing with py4web for a
> few days now and really am liking it.  It is crazy fast.  You may have to
> write some more helpers to do some things that web2py did for you, but
> that's half the fun, isn't it?  For instance, I used the grid that web2py's
> SQLFORM.grid provides for lots of listing pages.  py4web doesn't have one
> so I've written a helper that displays  pages the way my app wants to see
> them.
>
> I believe py4web is going to make it easier to use Vue.js in your pages,
> but I haven't made the just to using Vue yet so I can't really comment on
> that part.
>
> -Jim
>
> On Wednesday, January 22, 2020 at 12:33:10 PM UTC-6, Carlos Costa wrote:
>>
>> Hey Massimo, thanks for the great info.
>>
>> How about porting apps from web2py to py4web?
>>
>> What steps would you recommend?
>>
>> Em qua., 22 de jan. de 2020 às 08:21, AGRogers 
>> escreveu:
>>
>>> OK, thanks. Re reporting errors, I suspect most errors will be due to my
>>> ignorance. But thanks for the encouragement.
>>>
>>> On Tue, Jan 21, 2020, 1:26 PM Massimo Di Pierro 
>>> wrote:
>>>
 You should use the py4web documentation. Also please report any error
 you find.


 On Tuesday, 14 January 2020 22:03:59 UTC-8, Andrew Rogers wrote:
>
> Hi
>
> Is  the documentation for web2py still mostly relevant for py4web?
>
> Thanks
> Andrew
>
> On Thursday, 12 December 2019 20:47:05 UTC+6:30, icodk wrote:
>>
>> Should I use Web2py or py4web for a brand new project ?
>> What is still missing from py4web  ?
>> Can I debug with pycharm ?
>> I need all the great authentication I got with web2py :
>> Registration,pass change, groups mail, etc.
>> smartgreed will be very nice to have or similar.
>> Stability ?
>> Can it be deployed with nginx  and pg ?
>> 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 web...@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/web2py/d6c0a99a-42c9-4b04-91ab-56c8ac72b8c4%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 web...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/web2py/CACWMBMPjhvWrL3%2B0CtjSCFN_fc-246wAbGbBkWKi84Xfixn3Kg%40mail.gmail.com
>>> 
>>> .
>>>
>>
>>
>> --
>> At.
>>
>> Carlos J. Costa
>> --
>> Cientista da Computação - Esp. Gestão em Telecom
>>
> --
> 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 

Re: [web2py] Re: warning: new pydal

2020-01-06 Thread Kevin Keller
In postresql?

What issues do you have?

On Mon, Jan 6, 2020 at 7:24 PM Leonel Câmara  wrote:

> I seem to be having quite a few issues with json and jsonb fields.
>
> --
> 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/1d405d5f-6f7c-497c-b6e9-560955ade81d%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/CADHCKLQNRprD%3DgK0WU382UgPuD-GajvzZnWsqOEE1V2BFV%2BHwg%40mail.gmail.com.


[web2py] Took Py4Web on a spin.. few errors

2019-12-17 Thread Kevin Keller
Hey, 

I tried py4web from github today on ubuntu 18.04 python 3.6.9. 

Using the app scaffold creating a new app: works good

adding new fields in models, works ok: sometimes I get the error "table 
persons already exists". I only have that table persons. I need to restart.

Using Py4Web to create an create and update form works good. (Please keep 
the form/sqlform replacement around. Its great for protoyping and throw 
away apps. *Being able to use Py4Web for prototype, trow away apps plus 
serious projects from one framework is great.* 
I usually replace the SQLFORM forms after protoyping with proper forms) I 
really love the form generator for CRUD. 
I tested django-admlte2 and flask-appbuilder today for prototyping in case 
Py4Web deprecates SQLFORM, but noting is as good and quick as what you have 
done Massimo.

When I add the auth.user to the form the auth request ist not picked up.. I 
need to restart.
After the restart the get prompted to login or sign up. 
So I sign up.
Desperately tried to disable email validation until I found the link in the 
console to validate a user. After I removing a superflous "/" in the URL in 
the console registration worked. 
After logging in PY4Web crashes however: 


ERROR:root:Traceback (most recent call last):
  File "/home/ubuntu/Development/Python/DiPierro/py4web/py4web/core.py", 
line 473, in wrapper
ret = func(*func_args, **func_kwargs)
  File "/home/ubuntu/Development/Python/DiPierro/py4web/py4web/core.py", 
line 441, in wrapper
ret = obj.transform(ret)
  File "/home/ubuntu/Development/Python/DiPierro/py4web/py4web/core.py", 
line 253, in transform
delimiters=self.delimiters, reader=Template.reader)
  File 
"/home/ubuntu/.local/share/virtualenvs/py4web-hAK7z7VI/lib/python3.6/site-packages/yatl/template.py",
 
line 968, in render
exec(code, context)
  File "", line 23, in 
  File 
"/home/ubuntu/.local/share/virtualenvs/py4web-hAK7z7VI/lib/python3.6/site-packages/yatl/template.py",
 
line 831, in write
data = data.xml()
  File 
"/home/ubuntu/.local/share/virtualenvs/py4web-hAK7z7VI/lib/python3.6/site-packages/yatl/helpers.py",
 
line 52, in xml
for s in self.children)
  File 
"/home/ubuntu/.local/share/virtualenvs/py4web-hAK7z7VI/lib/python3.6/site-packages/yatl/helpers.py",
 
line 52, in 
for s in self.children)
  File 
"/home/ubuntu/.local/share/virtualenvs/py4web-hAK7z7VI/lib/python3.6/site-packages/yatl/helpers.py",
 
line 52, in xml
for s in self.children)
  File 
"/home/ubuntu/.local/share/virtualenvs/py4web-hAK7z7VI/lib/python3.6/site-packages/yatl/helpers.py",
 
line 52, in 
for s in self.children)
  File 
"/home/ubuntu/.local/share/virtualenvs/py4web-hAK7z7VI/lib/python3.6/site-packages/yatl/helpers.py",
 
line 52, in xml
for s in self.children)
  File 
"/home/ubuntu/.local/share/virtualenvs/py4web-hAK7z7VI/lib/python3.6/site-packages/yatl/helpers.py",
 
line 52, in 
for s in self.children)
  File 
"/home/ubuntu/.local/share/virtualenvs/py4web-hAK7z7VI/lib/python3.6/site-packages/yatl/helpers.py",
 
line 52, in xml
for s in self.children)
  File 
"/home/ubuntu/.local/share/virtualenvs/py4web-hAK7z7VI/lib/python3.6/site-packages/yatl/helpers.py",
 
line 52, in 
for s in self.children)
  File 
"/home/ubuntu/.local/share/virtualenvs/py4web-hAK7z7VI/lib/python3.6/site-packages/yatl/helpers.py",
 
line 52, in xml
for s in self.children)
  File 
"/home/ubuntu/.local/share/virtualenvs/py4web-hAK7z7VI/lib/python3.6/site-packages/yatl/helpers.py",
 
line 52, in 
for s in self.children)
  File 
"/home/ubuntu/.local/share/virtualenvs/py4web-hAK7z7VI/lib/python3.6/site-packages/yatl/helpers.py",
 
line 52, in xml
for s in self.children)
  File 
"/home/ubuntu/.local/share/virtualenvs/py4web-hAK7z7VI/lib/python3.6/site-packages/yatl/helpers.py",
 
line 52, in 
for s in self.children)
  File 
"/home/ubuntu/.local/share/virtualenvs/py4web-hAK7z7VI/lib/python3.6/site-packages/yatl/helpers.py",
 
line 52, in xml
for s in self.children)
  File 
"/home/ubuntu/.local/share/virtualenvs/py4web-hAK7z7VI/lib/python3.6/site-packages/yatl/helpers.py",
 
line 52, in 
for s in self.children)
  File 
"/home/ubuntu/.local/share/virtualenvs/py4web-hAK7z7VI/lib/python3.6/site-packages/yatl/helpers.py",
 
line 52, in xml
for s in self.children)
TypeError: sequence item 0: expected str instance, int found

My code: 

Models: 

"""
This file defines the database models
"""

from . common import db, Field
from pydal.validators import *

### Define your table below
#
# db.define_table('thing', Field('name'))
#
## always commit your models to avoid problems later
#
# db.commit()
#


db.define_table(
'person',
Field('name', requires=IS_NOT_IN_DB(db, 'person.name')),
Field('job', requires=IS_NOT_EMPTY()))

db.commit()

Controllers: 

from py4web import action, request, abort, redirect, URL
from yatl.helpers import A
from . common import db, session, T, cache, auth, logger

@action('index', 

Re: [web2py] Re: Web2py with python 3.8.0

2019-11-29 Thread Kevin Keller
Maybe, it wasn't on the radar of the django developers either and had to be
fixed in the framework after python3 was released.

Happens sometimes I suppose, hard to keep up with depreciation of functions
and the impact on a framework.

Anyways, I suppose we juar have to file the bug reports and fix each
function step by step until all deprecated functions are removed and
replaced with the ones that need to be used for python 3.8 and forward.





On Fri, 29 Nov 2019, 20:44 Woody,  wrote:

> Shouldn't that be done before the release rather than afterward?
>
> --
> 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/cbb87866-f170-4338-ba3f-e93dfc3861f3%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/CADHCKLSkb6MXuXE-u%3Dw2xP5bUOAyXvUsj4LBJH4W45ADQgUgDg%40mail.gmail.com.


Re: [web2py] Re: Web2py with python 3.8.0

2019-11-29 Thread Kevin Keller
Some deprecated functions have been removed in 3.8 finally.


Hence py4web and web2py have to adapt to the new situation.

Django went through the same process already.



On Fri, 29 Nov 2019, 14:11 Woody,  wrote:

> What is causing the problem with Python 3.8? Is it causing problems with
> other applications? Is it an undocumented bug in Python? Is it likely that
> Python will be changed to fix the problem or will web2py have to conform to
> the Python changes?
>
> --
> 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/e3321a7d-b518-49ec-8d57-9fcdc8886022%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/CADHCKLQb6jdXCTbYfFK%2BHBbeNFj6vieWksempq8J7A%2BCbYR29Q%40mail.gmail.com.


[web2py] Py4Web Rest API Test

2019-07-26 Thread Kevin Keller
Hello, 

this is in my controller: 

from pydal.restapi import RestAPI, Policy

policy = Policy()
policy.set('superhero', 'GET', authorize=True, allowed_patterns=['*'])
policy.set('*', 'GET', authorize=True, allowed_patterns=['*'])
policy.set('*', 'PUT', authorize=False)
policy.set('*', 'POST', authorize=False)
policy.set('*', 'DELETE', authorize=False)

@action('rest', method='GET')
def api():
return RestAPI(db, policy)(request.method, request.args(0), 
request.args(1),
 request.get_vars, request.post_vars)


and this in my models.py. 

db.define_table(
'person',
Field('name'),
Field('job'))

db.define_table(
'superhero',
Field('name'),
Field('real_identity', 'reference person'))

db.define_table(
'superpower',
Field('description'))

db.define_table(
'tag',
Field('superhero', 'reference superhero'),
Field('superpower', 'reference superpower'),
Field('strength', 'integer'))


But I get 404 no matter how I try to access... 

/test/rest/api.json/superhero?name.eq=Superman

Also had to change the import from the docs from dbapi to restapi.. 

-- 
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/633b22b0-9c43-432e-ab34-aea850c823fe%40googlegroups.com.


Re: [web2py] Re: web3py -> py4web

2019-07-24 Thread Kevin Keller
Which file Antonio?

I found what seems an Oauth2 server py and pyjwt in core.

So I suppose OAuth2 + OpenID Restful API can be done with web4py already..
just need to find in the docs..

By the way.. happy to contribute to the docs.



On Wed, Jul 24, 2019 at 1:21 PM António Ramos  wrote:

>
> Found a typo RestPI instead of RestAPI
>
> Regardsdef api():
> return RestPI(db, policy)(request.method, request.args(0), 
> request.args(1),
>  request.get_vars, request.post_vars)
>
>
> Em qua, 24 de jul de 2019 às 12:17, António Ramos 
> escreveu:
>
>> - Great documentation layout
>> - A litle bette name (Py4Web)
>> - But the dashboard and the running circle and colours chosen are
>> completely out of order in my opinion if it matters. Where is the logo ?
>> will it have a logo ? what colour scheme will it use ?
>>
>> Regards
>>
>> Em qua, 24 de jul de 2019 às 09:44, Kevin Keller 
>> escreveu:
>>
>>> Would live to try it today.
>>>
>>> Is there documentation how I can enable to require auth and use JWT for
>>> the PyDal REST API?
>>>
>>> On Wednesday, 24 July 2019 07:40:27 UTC+2, Massimo Di Pierro wrote:
>>>>
>>>> OK. I know. I am not good with names.
>>>> But there are lots of requirements to be fulfilled.
>>>> py4web.com was available and the pypi package was available.
>>>> Here is running on google cloud:
>>>> http://py4web.com/
>>>>
>>>> Ducking...
>>>>
>>>> --
>>> 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/f481ba65-8026-46a9-a230-77e8edda9e37%40googlegroups.com
>>> <https://groups.google.com/d/msgid/web2py/f481ba65-8026-46a9-a230-77e8edda9e37%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/CAEM0BxNz%2BhEcVhzgTeVU3s-1-z1MgsunXv%2Bgm1sonjdmFEBcQA%40mail.gmail.com
> <https://groups.google.com/d/msgid/web2py/CAEM0BxNz%2BhEcVhzgTeVU3s-1-z1MgsunXv%2Bgm1sonjdmFEBcQA%40mail.gmail.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/CADHCKLRXX4Mh%2B%3DxsM-30pBDiH5emECwFx8zBxxdDGX_i%3DZegmA%40mail.gmail.com.


[web2py] Re: web3py -> py4web

2019-07-24 Thread Kevin Keller
Would live to try it today. 

Is there documentation how I can enable to require auth and use JWT for the 
PyDal REST API?

On Wednesday, 24 July 2019 07:40:27 UTC+2, Massimo Di Pierro wrote:
>
> OK. I know. I am not good with names. 
> But there are lots of requirements to be fulfilled.
> py4web.com was available and the pypi package was available.
> Here is running on google cloud:
> http://py4web.com/
>
> Ducking...
>
>

-- 
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/f481ba65-8026-46a9-a230-77e8edda9e37%40googlegroups.com.


Re: [web2py] Re: Anthony was right... web3py has a big naming conflict

2019-07-22 Thread Kevin Keller
+1 for Massimo

On Mon, 22 Jul 2019, 19:05 António Ramos,  wrote:

> Just call it
> *Massimo*
> It is very well deserved right ???
>
> Em seg, 22 de jul de 2019 às 17:42, Ivica Kralj 
> escreveu:
>
>> I can't let gluon go :)  so how about
>>
>>
>> Gluonic
>>
>>
>> trademark seems to be available
>> https://www.trademarkia.com/trademarks-search.aspx?tn=gluonic
>>
>> gluonic dot com is parked for the last 2000 days. However, some of the
>> top-level domains are available .co, .net, .tech, .info, .online, .dev...
>>
>>
>> https://domains.google.com/m/registrar/search?searchTerm=gluonic=en&_ga=2.204003988.549408078.1563812529-1656870076.1563812529=1=
>>
>> google search
>> About 160,000 results
>>
>>
>> On Monday, 22 July 2019 15:40:35 UTC+2, Ivica Kralj wrote:
>>>
>>> It needs to be changed for sure.
>>>
>>> I really like gluon (even Microsoft joined this bandwagon)...
>>>
>>> So maybe inspiration could come from quantum phisics again. Scrap
>>> that... Most cool named subatomic particles are already used (muon)...
>>>
>>> How about something relating to python species (sebae). not sure how to
>>> pronounce this :) !!
>>>
>>> Now that I contributed a tiny bit, in my humble opinion, I wouldn't go
>>> 'web' or 'py' rute.
>>>
>>> --
>> 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/70abbe6b-586e-42bd-ab35-038d686c454c%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/CAEM0BxPCKBxy8jJ85AwiynOeY%2B4H40FnusR3%2BH0zD0xnER8ZQw%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/CADHCKLTZoQWpOeCvsyv%2BjgEVjEkEz0U%2BZPx__iGxGgi-M8r1rQ%40mail.gmail.com.


[web2py] Scaffold Web2py Models and SQLForm.smartgrid

2019-05-19 Thread Kevin Keller
Hello, 

has anyone written a scaffolder ideally web based, where a non technical 
user can define tables and fields including relations 
and the new app getes generated and put into the applications folder or by 
creating a new controller with SQLFORM.smartgrid on the 
tables defined by the user?

I want to make it easy for non-technical users to add crud pages in web2py 
easily. 

I have worked with the admin wizard app and am looking at it now for some 
inspiration, but 
it is still too technical for a non technical user with terms like "tables" 
and "auth_table" pre-defined etc and also needing to 
know the field types by heart etc.

I will probably just rewrite the wizard to be more user friendly and expose 
it in my web2py app. 

but if anyone has already done something similiar, please let me know. 

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/72f5a6ed-a446-4d32-bf2f-1c370996bb3d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: Web3py

2019-04-21 Thread Kevin Keller
I was wrong.. Found a recent integration with bottle  and oauthlib..
https://github.com/thomsonreuters/bottle-oauthlib/blob/master/README.md

Now we only need to figure out jwt and easy rest crud.. Which bottle is
perfect for and finally use the before mentioned openapi generator with
bottle and we are good to go.



On Sun, 21 Apr 2019, 12:05 Kevin Keller,  wrote:

> Authentication + authorization and documentation of endpoints are actually
> the hardest part.
>
> There is a. Flask based framework called connexxion which asks you to
> create the openapi spec before the code which has jwt and oauth2 build in
> as. Well.
>
>
> Then there are flask Rebar which can use jwt and auth0 build in . Also
> gernatrss openapi 2 documentation.
>
> And there is Sars., also a Flask based framework thst generates openapi 2
> documentation and can easily extend with jwt and oauth2 via flask plug-ins.
>
> There is also hug, based on the falcon framework.. Also generates openapi
> v2 documentation and has an oauth2 plugin and does jwt build in.
>
> Thus I was thinking to bring up this topic early.
>
> Bottle does not have this kind of out of the box suopport, but there is a
> framework agnostic openapi generator we could use :
> https://apispec.readthedocs.io/en/stable/
>
> And we could create a oauth2 plugin for bottle (the current one is
> deprecated) based on authlib.
> Authlib also has the ability to generate jwt tokens, but for standalone
> tokens we could use pyjwt I guess.
>
> When we scaffold crud apis and vue frontends with authentication in place
> thst would be great just as it was with web2py by just using a decorator I.
> E. Crud api routes and functions and authentication via tokens and/or
> oauth2.
>
> The openapi makes it easy to collaborate with others in Microservice
> environment and also gives users the ability to generate UIs sich as with
> angular and react based on openapi specs Web3py generated for thr enpoints.
>
>
>
>
>
> On Sun, 21 Apr 2019, 04:03 黄祥,  wrote:
>
>> scaffolding app would be nice to have example of authentication (user
>> registration, login and logout) and to update the data, e.g. update todo
>> list on todo app
>> just wondering, if form used manually using javascript, is the field
>> validation on pydal, still can work ? e.g. requires=IS_NOT_EMPTY()
>>
>> best regards,
>> stifan
>>
>> --
>> Resources:
>> - http://web2py.com
>> - http://web2py.com/book (Documentation)
>> - http://github.com/web2py/web2py (Source code)
>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "web2py-users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to web2py+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: Web3py

2019-04-21 Thread Kevin Keller
Authentication + authorization and documentation of endpoints are actually
the hardest part.

There is a. Flask based framework called connexxion which asks you to
create the openapi spec before the code which has jwt and oauth2 build in
as. Well.


Then there are flask Rebar which can use jwt and auth0 build in . Also
gernatrss openapi 2 documentation.

And there is Sars., also a Flask based framework thst generates openapi 2
documentation and can easily extend with jwt and oauth2 via flask plug-ins.

There is also hug, based on the falcon framework.. Also generates openapi
v2 documentation and has an oauth2 plugin and does jwt build in.

Thus I was thinking to bring up this topic early.

Bottle does not have this kind of out of the box suopport, but there is a
framework agnostic openapi generator we could use :
https://apispec.readthedocs.io/en/stable/

And we could create a oauth2 plugin for bottle (the current one is
deprecated) based on authlib.
Authlib also has the ability to generate jwt tokens, but for standalone
tokens we could use pyjwt I guess.

When we scaffold crud apis and vue frontends with authentication in place
thst would be great just as it was with web2py by just using a decorator I.
E. Crud api routes and functions and authentication via tokens and/or
oauth2.

The openapi makes it easy to collaborate with others in Microservice
environment and also gives users the ability to generate UIs sich as with
angular and react based on openapi specs Web3py generated for thr enpoints.





On Sun, 21 Apr 2019, 04:03 黄祥,  wrote:

> scaffolding app would be nice to have example of authentication (user
> registration, login and logout) and to update the data, e.g. update todo
> list on todo app
> just wondering, if form used manually using javascript, is the field
> validation on pydal, still can work ? e.g. requires=IS_NOT_EMPTY()
>
> best regards,
> stifan
>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Web3py

2019-04-18 Thread Kevin Keller
Yeah saw that too.

I agree it's worthwhile to go for a different name eventually. 

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Enjoying web2py

2019-04-18 Thread Kevin Keller
Just wanted to say that im working on app on an old Acer one 32 bit 2gb machine 
with web2py, midori as Browser and Vim as code editor and I'm enjoying it a lot!

Thanks for creating such a great batteries included framework. 

I barely had to touch html so far to get the prototype working and I didn't 
have to configuring or installing anything. 

It's pure productivity. 

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: Problem with oracle query

2019-04-16 Thread Kevin Keller
When a table is created in Oracle, it is always created in uppercase
letters, if not created by using quotes.

create table test= TEST
create table "test" = test

it is very likely that the table when created, was created without quotes
and hence the table name is saved in uppercase letters.
Now you query using quotes in lowercase letters and it doesnt find the
table.
when you removed the quotes, Oracle defaults to uppercase letters again and
found the table.



On Tue, Apr 16, 2019 at 7:53 AM Massimo Di Pierro <
massimo.dipie...@gmail.com> wrote:

> Damn Oracle! Can you find some documentation that says that quoting of
> table names is not supported and we will change? Want to make sure there
> not some other configuration quirk before removing a useful feature.
>
> On Monday, 15 April 2019 04:20:36 UTC-7, gliporace wrote:
>>
>> I think I found the problem:
>> the query is sent with the table name double-quoted:
>>
>> select "ana_paz"."COGNOME", "ana_paz"."NOME" from "ana_paz" where
>> "ana_paz"."COGNOME"='ROSSI'  <--- doesn't not work ("table or view does
>> not exists")
>>
>> select ana_paz."COGNOME", ana_paz."NOME" from "ana_paz" where
>> ana_paz."COGNOME"='ROSSI'  < works
>>
>> Setting
>> entity_quoting = False
>>
>> in the database connection solved the problem.
>>
>>
>>
>> Il giorno venerdì 12 aprile 2019 17:00:14 UTC+2, gliporace ha scritto:
>>>
>>> Hi,
>>> I just updated my web2py installation from 2.11 to 2.18.5, but the apps
>>> who make use of cx_Oracle for connecting to a Oracle database show this
>>> error
>>> when ther try to query a table/view:
>>>
>>> Exception ORA-00942: table or view does not exist
>>>
>>> The old web2py installation run without problems on a Ubuntu server
>>> 14.04 and cx_Oracle 5.3, the new installation is on Ubuntu server 16.04
>>> with the same version of cx_Oracle.
>>>
>>> Is there any means to check what is the query before is sent to the
>>> server?
>>>
>> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Thoughts on Rules+Workflow engine

2019-04-15 Thread Kevin Keller
Hey everyone,

I am pondering currently to create a web app that can create dynamic forms, 
which when submitted create a "document". 

The forms can be configured by users.

Each document is attached to a workflow with different statuses, i.e. 
"rejected" "approved"
After submission and during transition from one to another state, there is 
a rules engine that checks a user confiurable rules, 
implemented as dynamic DB queries in the backend.

If a document fullfills certain rules in is transitioned into a status 
based on the rules and will put certain tasks i.e. approve/rject document 
into a users queue. 
When a task is fullfilled it triggers a callback to set the task to done 
and re-run the rules engine to see of there are tasks outstanding, of not, 
what the next status is 
or if the next status is "end".

Sample: 

Travel request. 

if costs below 1000 euro requests gets auto approved.
if between 1000-1 reuqest needs manager approval
if above 1 euro requests needs manaager and senior manager approval. 
Approvals can be done in parallel or chronologically. 

I was thinking to use Mongodb for this. 

Has anyone already done some work around dynamic forms, dynamic queres and 
rules or/and workflow engine with web2py?
If so, are you willing to build something based on your experience? 

If not, I ll just get going and will share my code. 

I was thinking to use https://gojs.net/latest/index.html for the worklfow 
visualzation eventually. 


-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: Does web2py support SSE (server sent events) from HTML5?

2019-04-14 Thread Kevin Keller
Whats wrong with polling every so often?



On Sun, 14 Apr 2019, 19:41 Kevin Keller,  wrote:

> Should do it
>
> https://www.tornadoweb.org/en/stable/wsgi.html
>
> On Sun, 14 Apr 2019, 09:18 Massimo Di Pierro, 
> wrote:
>
>> I do not know.
>>
>> On Saturday, 13 April 2019 12:06:46 UTC-7, João Matos wrote:
>>>
>>> It would be great if web3py would support SSE.
>>>
>>> For now, the websocket solution would work with Apache?
>>>
>>> sábado, 13 de Abril de 2019 às 16:26:13 UTC+1, Massimo Di Pierro
>>> escreveu:
>>>>
>>>> No. we do provide a web2py/gluon/contrib/websocket_messaging.py which
>>>> uses tornado and webocket for the same purpose.
>>>> web3py may provide this functionality.
>>>>
>>>> On Friday, 12 April 2019 15:36:38 UTC-7, João Matos wrote:
>>>>>
>>>>> Does web2py support SSE (server sent events) from HTML5?
>>>>> https://www.w3schools.com/html/html5_serversentevents.asp
>>>>>
>>>> --
>> Resources:
>> - http://web2py.com
>> - http://web2py.com/book (Documentation)
>> - http://github.com/web2py/web2py (Source code)
>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "web2py-users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to web2py+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: Does web2py support SSE (server sent events) from HTML5?

2019-04-14 Thread Kevin Keller
Should do it

https://www.tornadoweb.org/en/stable/wsgi.html

On Sun, 14 Apr 2019, 09:18 Massimo Di Pierro, 
wrote:

> I do not know.
>
> On Saturday, 13 April 2019 12:06:46 UTC-7, João Matos wrote:
>>
>> It would be great if web3py would support SSE.
>>
>> For now, the websocket solution would work with Apache?
>>
>> sábado, 13 de Abril de 2019 às 16:26:13 UTC+1, Massimo Di Pierro escreveu:
>>>
>>> No. we do provide a web2py/gluon/contrib/websocket_messaging.py which
>>> uses tornado and webocket for the same purpose.
>>> web3py may provide this functionality.
>>>
>>> On Friday, 12 April 2019 15:36:38 UTC-7, João Matos wrote:

 Does web2py support SSE (server sent events) from HTML5?
 https://www.w3schools.com/html/html5_serversentevents.asp

>>> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] YATL + pyDAL with Flask.. template not rendering with right variable

2019-04-14 Thread Kevin Keller
Having a translation layer for different frameworks would be too much to
maintain I think.

But if you could implement a way that some defaults can be easily
overrriden, where it makes sense.. that would be great.

What that means will be a bit different from module to module I suppose,
but for the case of Form. Py which will eventually generate its own
submit/post requesr route, an easy way to change the standard post url
would make it easy to adapt it form.py for different frameworks.



On Sun, 14 Apr 2019, 16:57 Massimo Di Pierro, 
wrote:

> I would be happy to keep the logic in form.py and other upcoming modules
> framework agnostic. If you have ideas about how to best do that, please let
> me know
>
> On Saturday, 13 April 2019 10:03:49 UTC-7, Kevin Keller wrote:
>>
>> Changing the import headers of form.py from web3py like this:
>>
>> import uuid
>> import hmac
>> from pydal import DAL
>> from flask import request
>> from yatl.helpers import A, TEXTAREA, INPUT, TR, TD, TABLE, DIV, LABEL,
>> FORM
>> from pydal._compat import to_bytes
>>
>>
>> and with the rest of the sample code like this:
>>
>> from flask import Flask
>> from yatl import render, SPAN
>> from form import  Form
>> app = Flask(__name__)
>>
>> from pydal import DAL, Field
>> db = DAL('sqlite://storage.db')
>> db.define_table('thing', Field('name'))
>> db.thing.insert(name='Chair')
>> query = db.thing.name.startswith('C')
>> db.commit()
>>
>>
>> @app.route('/')
>> def hello():
>> db._adapter.reconnect()
>> rows = db(query).select()
>> db._adapter.close()
>> form = Form(db.thing)
>> example = """
>> 
>>  hello! {{=rows[0].name}} 
>> {{=form}}
>> {{ pass }}
>> 
>> """
>> print (rows[0].name)
>> return render(example,context={'rows':rows,'form':form},
>> delimiters="{{ }}")
>>
>> app.run(host='0.0.0.0',use_reloader=False)
>>
>> The Form is rendered correctly.
>>
>> The action URL only would need an overriding option and one would also
>> need to define a POST route.
>>
>> Then it should work.
>>
>> Was fun playing with it.. so far it seems the work you do with bottle is
>> easily transferrable to Flask or Pyramid as well with minor modifications..
>>
>>
>>
>>
>>
>> On Sat, Apr 13, 2019 at 6:25 PM Kevin Keller  wrote:
>>
>>> Ok got it.. just forgot to actually use yatl right...
>>>
>>> from flask import Flask
>>> from yatl import render, SPAN
>>> app = Flask(__name__)
>>>
>>> from pydal import DAL, Field
>>> db = DAL('sqlite://storage.db')
>>> db.define_table('thing', Field('name'))
>>> db.thing.insert(name='Chair')
>>> query = db.thing.name.startswith('C')
>>> db.commit()
>>>
>>>
>>> @app.route('/')
>>> def hello():
>>> db._adapter.reconnect()
>>> rows = db(query).select()
>>> db._adapter.close()
>>> example = """
>>> 
>>>  hello! {{=rows[0].name}} 
>>> {{ pass }}
>>> 
>>> """
>>> print (rows[0].name)
>>> return render(example,context={'rows':rows}, delimiters="{{ }}")
>>>
>>> app.run(host='0.0.0.0',use_reloader=False)
>>>
>>>
>>>
>>> On Sat, Apr 13, 2019 at 6:06 PM Kevin Keller 
>>> wrote:
>>>
>>>>  return render(example,context={'rows':rows}, delimiters="{{ }}")
>>>>
>>>> Also does not work..
>>>>
>>>> On Sat, Apr 13, 2019 at 5:47 PM Kevin Keller 
>>>> wrote:
>>>>
>>>>> I only get the h1 Hello World in the browser, but I struggle to pass
>>>>> over values to the templates with yatl
>>>>>
>>>>> is context=(rows=rows) the correct way?
>>>>>
>>>>> See the last return statement.
>>>>>
>>>>> The print command outputs "Chair" as expected.
>>>>>
>>>>> The HTML file should output
>>>>>
>>>>> Hello! Chair
>>>>>
>>>>>
>>>>>
>>>>> from flask import Flask
>>>>> from yatl import render, SPAN
>>>>> app = Flask(__name__)
>>>>>
>>>>> from pydal import DAL, Field
>>>>> db = DAL('sqlite://storage.db')
>>>>>

Re: [web2py] YATL + pyDAL with Flask.. template not rendering with right variable

2019-04-13 Thread Kevin Keller
Changing the import headers of form.py from web3py like this:

import uuid
import hmac
from pydal import DAL
from flask import request
from yatl.helpers import A, TEXTAREA, INPUT, TR, TD, TABLE, DIV, LABEL, FORM
from pydal._compat import to_bytes


and with the rest of the sample code like this:

from flask import Flask
from yatl import render, SPAN
from form import  Form
app = Flask(__name__)

from pydal import DAL, Field
db = DAL('sqlite://storage.db')
db.define_table('thing', Field('name'))
db.thing.insert(name='Chair')
query = db.thing.name.startswith('C')
db.commit()


@app.route('/')
def hello():
db._adapter.reconnect()
rows = db(query).select()
db._adapter.close()
form = Form(db.thing)
example = """

 hello! {{=rows[0].name}} 
{{=form}}
{{ pass }}

"""
print (rows[0].name)
return render(example,context={'rows':rows,'form':form}, delimiters="{{
}}")

app.run(host='0.0.0.0',use_reloader=False)

The Form is rendered correctly.

The action URL only would need an overriding option and one would also need
to define a POST route.

Then it should work.

Was fun playing with it.. so far it seems the work you do with bottle is
easily transferrable to Flask or Pyramid as well with minor modifications..





On Sat, Apr 13, 2019 at 6:25 PM Kevin Keller  wrote:

> Ok got it.. just forgot to actually use yatl right...
>
> from flask import Flask
> from yatl import render, SPAN
> app = Flask(__name__)
>
> from pydal import DAL, Field
> db = DAL('sqlite://storage.db')
> db.define_table('thing', Field('name'))
> db.thing.insert(name='Chair')
> query = db.thing.name.startswith('C')
> db.commit()
>
>
> @app.route('/')
> def hello():
> db._adapter.reconnect()
> rows = db(query).select()
> db._adapter.close()
> example = """
> 
>  hello! {{=rows[0].name}} 
> {{ pass }}
> 
> """
> print (rows[0].name)
> return render(example,context={'rows':rows}, delimiters="{{ }}")
>
> app.run(host='0.0.0.0',use_reloader=False)
>
>
>
> On Sat, Apr 13, 2019 at 6:06 PM Kevin Keller  wrote:
>
>>  return render(example,context={'rows':rows}, delimiters="{{ }}")
>>
>> Also does not work..
>>
>> On Sat, Apr 13, 2019 at 5:47 PM Kevin Keller  wrote:
>>
>>> I only get the h1 Hello World in the browser, but I struggle to pass
>>> over values to the templates with yatl
>>>
>>> is context=(rows=rows) the correct way?
>>>
>>> See the last return statement.
>>>
>>> The print command outputs "Chair" as expected.
>>>
>>> The HTML file should output
>>>
>>> Hello! Chair
>>>
>>>
>>>
>>> from flask import Flask
>>> from yatl import render, SPAN
>>> app = Flask(__name__)
>>>
>>> from pydal import DAL, Field
>>> db = DAL('sqlite://storage.db')
>>> db.define_table('thing', Field('name'))
>>> db.thing.insert(name='Chair')
>>> query = db.thing.name.startswith('C')
>>> db.commit()
>>>
>>>
>>> @app.route('/')
>>> def hello():
>>> db._adapter.reconnect()
>>> rows = db(query).select()
>>> db._adapter.close()
>>> example = """
>>> 
>>>  hello! {{rows[0].name}} 
>>> {{ pass }}
>>> 
>>> """
>>> print (rows[0].name)
>>> return render(example,context=dict(rows=rows), delimiters="{{ }}")
>>>
>>> app.run(host='0.0.0.0',use_reloader=False)
>>>
>>> --
>>> Resources:
>>> - http://web2py.com
>>> - http://web2py.com/book (Documentation)
>>> - http://github.com/web2py/web2py (Source code)
>>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>>> ---
>>> You received this message because you are subscribed to the Google
>>> Groups "web2py-users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to web2py+unsubscr...@googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] YATL + pyDAL with Flask.. template not rendering with right variable

2019-04-13 Thread Kevin Keller
Ok got it.. just forgot to actually use yatl right...

from flask import Flask
from yatl import render, SPAN
app = Flask(__name__)

from pydal import DAL, Field
db = DAL('sqlite://storage.db')
db.define_table('thing', Field('name'))
db.thing.insert(name='Chair')
query = db.thing.name.startswith('C')
db.commit()


@app.route('/')
def hello():
db._adapter.reconnect()
rows = db(query).select()
db._adapter.close()
example = """

 hello! {{=rows[0].name}} 
{{ pass }}

"""
print (rows[0].name)
return render(example,context={'rows':rows}, delimiters="{{ }}")

app.run(host='0.0.0.0',use_reloader=False)



On Sat, Apr 13, 2019 at 6:06 PM Kevin Keller  wrote:

>  return render(example,context={'rows':rows}, delimiters="{{ }}")
>
> Also does not work..
>
> On Sat, Apr 13, 2019 at 5:47 PM Kevin Keller  wrote:
>
>> I only get the h1 Hello World in the browser, but I struggle to pass over
>> values to the templates with yatl
>>
>> is context=(rows=rows) the correct way?
>>
>> See the last return statement.
>>
>> The print command outputs "Chair" as expected.
>>
>> The HTML file should output
>>
>> Hello! Chair
>>
>>
>>
>> from flask import Flask
>> from yatl import render, SPAN
>> app = Flask(__name__)
>>
>> from pydal import DAL, Field
>> db = DAL('sqlite://storage.db')
>> db.define_table('thing', Field('name'))
>> db.thing.insert(name='Chair')
>> query = db.thing.name.startswith('C')
>> db.commit()
>>
>>
>> @app.route('/')
>> def hello():
>> db._adapter.reconnect()
>> rows = db(query).select()
>> db._adapter.close()
>> example = """
>> 
>>  hello! {{rows[0].name}} 
>> {{ pass }}
>> 
>> """
>> print (rows[0].name)
>> return render(example,context=dict(rows=rows), delimiters="{{ }}")
>>
>> app.run(host='0.0.0.0',use_reloader=False)
>>
>> --
>> Resources:
>> - http://web2py.com
>> - http://web2py.com/book (Documentation)
>> - http://github.com/web2py/web2py (Source code)
>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "web2py-users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to web2py+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] YATL + pyDAL with Flask.. template not rendering with right variable

2019-04-13 Thread Kevin Keller
 return render(example,context={'rows':rows}, delimiters="{{ }}")

Also does not work..

On Sat, Apr 13, 2019 at 5:47 PM Kevin Keller  wrote:

> I only get the h1 Hello World in the browser, but I struggle to pass over
> values to the templates with yatl
>
> is context=(rows=rows) the correct way?
>
> See the last return statement.
>
> The print command outputs "Chair" as expected.
>
> The HTML file should output
>
> Hello! Chair
>
>
>
> from flask import Flask
> from yatl import render, SPAN
> app = Flask(__name__)
>
> from pydal import DAL, Field
> db = DAL('sqlite://storage.db')
> db.define_table('thing', Field('name'))
> db.thing.insert(name='Chair')
> query = db.thing.name.startswith('C')
> db.commit()
>
>
> @app.route('/')
> def hello():
> db._adapter.reconnect()
> rows = db(query).select()
> db._adapter.close()
> example = """
> 
>  hello! {{rows[0].name}} 
> {{ pass }}
> 
> """
> print (rows[0].name)
> return render(example,context=dict(rows=rows), delimiters="{{ }}")
>
> app.run(host='0.0.0.0',use_reloader=False)
>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] YATL + pyDAL with Flask.. template not rendering with right variable

2019-04-13 Thread Kevin Keller
I only get the h1 Hello World in the browser, but I struggle to pass over 
values to the templates with yatl

is context=(rows=rows) the correct way?

See the last return statement. 

The print command outputs "Chair" as expected. 

The HTML file should output 

Hello! Chair



from flask import Flask
from yatl import render, SPAN
app = Flask(__name__)

from pydal import DAL, Field
db = DAL('sqlite://storage.db')
db.define_table('thing', Field('name'))
db.thing.insert(name='Chair')
query = db.thing.name.startswith('C')
db.commit()


@app.route('/')
def hello():
db._adapter.reconnect()
rows = db(query).select()
db._adapter.close()
example = """

 hello! {{rows[0].name}} 
{{ pass }}

"""
print (rows[0].name)
return render(example,context=dict(rows=rows), delimiters="{{ }}")

app.run(host='0.0.0.0',use_reloader=False)

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: Web3py

2019-04-13 Thread Kevin Keller
Geat progress Massimo.

Looks awesome!

I take it we stick to bottle then and embrace vue.js as the default
frontend of choice.

I suppose on the long run we just have to think about some standard glue
code generation that also works with Auth and jwt on the rest endpoints.
Possibly swagger / openapi auto Generation as a plus.


Wish I would not be such a noob at coding but maybe I can look into some of
it.



On Fri, 12 Apr 2019, 22:34 Massimo Di Pierro, 
wrote:

> Can you make it a module on pypi? Or should we include it in pydal?
>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: Web3py

2019-04-12 Thread Kevin Keller
I'm interestes in the orm Carlos.

keller...@gmail.com

Happy to test it but also work on it with you.



On Fri, 12 Apr 2019, 18:46 En Ware,  wrote:

> Not getting examples to work is /examples/form or examples ?
>
> On Friday, April 12, 2019 at 10:29:21 AM UTC-5, Massimo Di Pierro wrote:
>>
>> In web3py an application is a folder, for example "myapp". It must have:
>>
>> applications/
>>   myapp/
>> __init__.py
>> templates/
>> static/
>> databases/
>>
>> otherwise the structure is free. You are free to create models/ and
>> controllers/ and organize code like in the old web2py but the entry point
>> is __init__.py. Web3py will see functions defined in __init_ or imported by
>> init. In my examples I defined all actions in __init__. For example
>>
>> In __init__.py =
>> from . import models
>> from . import controllers
>>
>> In model.py =
>> from web3py import DAL, Field
>> db = DAL('sqlite://test')
>> db.define_table('thing', Field('name'))
>>
>> In controllers.py =
>> from web3py import action, request, redirect, abort
>> from . models import db
>> @action('helloworld') # exposes http://127.0.0.1:8000/myapp/helloworld
>> @action.uses(db, 'helloworld.html')
>> def helloworld(): return dict(name=request.forms.get('name', 'visitor'))
>>
>> In templates/helloworld.html =
>> [[extend 'layout.html']]
>> Hello Dear [[=name]]
>>
>> In templates/layout.html =
>> [[include]]
>>
>>
>> request, redirect, abort are Bottely objects
>> DAL, Field are web2py's
>> the template is the same as web2py but defaults to [[ ]] delimiters to
>> avoid conflicts with vue.js and other js
>> the @action decorator accepts the same parameters as bottle.route but
>> does a little more.
>> There is also a form.py that implements Form() a drop in replacement (to
>> be tested) for SQLFORM.
>>
>> Notice we do all of this in 300 lines of python code and 10x faster than
>> web2py in my tests.
>>
>> Working on admin and appadmin. May be done in one week.
>>
>> Massimo
>>
>>
>>
>>
>>
>> On Friday, 12 April 2019 06:53:57 UTC-7, En Ware wrote:
>>>
>>> I'm trying to wrap my ahead around how web3py works by looking at the
>>> source
>>>
>>> I see __init__.py is the main code for the actually todo app.
>>>
>>> Is this going to be the case for all applications ? or is this just for
>>> a sample ?
>>>
>>>
>>> On Thursday, April 11, 2019 at 11:03:29 PM UTC-5, Massimo Di Pierro
>>> wrote:

 There is a lot to do but at this point it is moving fast and a one way
 street.

 On Thursday, 11 April 2019 10:31:29 UTC-7, En Ware wrote:
>
> I git installed web3py and quite enjoy it. I see its updated regular
> too.
>
> For those who don't know and maybe this is common sense , not sure.
>
> once you *git clone https://github.com/web2py/web3py.git
>   *do a *git pull*
>
> 2. reinstall requirements.txt (*pip3 install -r requirements.txt*)
>  - Changes:  module "reloader" was added
>
> 3. Launch web3py (should work just fine now)
>
> * python3 web3py.py applications/todo/*
>
> 4. open browser and type: * localhost:8000 or 127.0.0.1:8000
> /todo/index*
>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: Web3py

2019-04-12 Thread Kevin Keller
Any thoughts on merging / collaborating with weppy?

http://weppy.org/

Uses web2py dal and yatl..
and has some nifty things to make queries and modelling easier..



On Fri, Apr 12, 2019 at 6:03 AM Massimo Di Pierro <
massimo.dipie...@gmail.com> wrote:

> There is a lot to do but at this point it is moving fast and a one way
> street.
>
> On Thursday, 11 April 2019 10:31:29 UTC-7, En Ware wrote:
>>
>> I git installed web3py and quite enjoy it. I see its updated regular too.
>>
>> For those who don't know and maybe this is common sense , not sure.
>>
>> once you *git clone https://github.com/web2py/web3py.git
>>   *do a *git pull*
>>
>> 2. reinstall requirements.txt (*pip3 install -r requirements.txt*)
>>  - Changes:  module "reloader" was added
>>
>> 3. Launch web3py (should work just fine now)
>>
>> * python3 web3py.py applications/todo/*
>>
>> 4. open browser and type: * localhost:8000 or 127.0.0.1:8000
>> /todo/index*
>>
>> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: web3py again....

2019-04-07 Thread Kevin Keller
I couldn't find the numbers that quickly, but key point is the bigger Flask
community and plugin availability. Also if people look for job for
companies that use python most of the time they look for Flask or Django
experience.

Web3Py build on Flask would also remove the questions for beginners if they
should use Flask or Web3py in which case they will most likely start with
Flask.

With Web3py having a flask component but the added value of pydal, yatl,
sqlform and web2py Auth they would go for Web3py for sure.

Now I perfectly understand however, that Web3py based on bottle would have
a higher potential to be its own thing and find a community of its own and
possibly even increase interest in all its moving parts such as bottle in
reverse.

And also effectively reducing the risk of Web3py being seen as just an
extension as it could possibly happen with Flask, but actually being seen
for what it is: much more than its moving parts combined.






I guess it depends which end goal is more desirable.



On Sun, 7 Apr 2019, 06:32 Massimo Di Pierro, 
wrote:

> I like bottle because it is simpler than flask. Can you make a good case
> for why Flask over bottle?
>
> On Tuesday, 2 April 2019 00:56:31 UTC-7, Kevin Keller wrote:
>>
>> Here is a project that generates swagger(openapi) documentation for
>> flask+sqlalchemy.  https://github.com/thomaxxl/safrs
>> I was already wondering about changing bottle with flask, but I dont know
>> if that is heresy now :).
>>
>> On Tue, Apr 2, 2019 at 9:31 AM Kevin Keller  wrote:
>>
>>>
>>> https://editor.swagger.io/?_ga=2.227432986.689200959.1554189909-55439989.1547630410
>>>
>>>
>>> Swagger JSON editor + https://swagger.io/specification/. So one Swagger
>>> Json file can contain the description of all the endpoints.
>>>
>>> On Tue, Apr 2, 2019 at 9:19 AM Kevin Keller  wrote:
>>>
>>>> I agree.
>>>>
>>>> In fact, the whole client side today should be Javascript and just
>>>> communicate via REST+JWT (even though in the enerprise space you will also
>>>> need OAUTH2).
>>>>
>>>>  The models need to be exposed via REST easiliy and it should be easy
>>>> to add auth to routes with JWT. Also the REST endpoints once defined, need
>>>> to generate openapi(swagger) documents automatically.
>>>>
>>>> This is much like the JSON route you wanted to go, but with openapi we
>>>> would be using an actual standard and do not tie ourselves to one
>>>> Javascript framework and once specific JSON format.
>>>>
>>>>  With that we could use something like this:
>>>> https://api-platform.com/docs/client-generator/ that generates Vue.js
>>>> or React.js CRUD pages basted on teh openapi documentation for the REST
>>>> endpoints.
>>>>
>>>> On Tue, Apr 2, 2019 at 8:58 AM Massimo Di Pierro <
>>>> massimo.dipie...@gmail.com> wrote:
>>>>
>>>>> Th problem with SQLFORM is that different CSS libraries require
>>>>> different HTML stuctures. It is not as simple as selecting a class or div
>>>>> vs span. In web2py we have code to deal with bootstrap 2 and 3. We apply
>>>>> both classes. It is horrible. We should move away from generating html
>>>>> server side for forms. We should pass a json description and generate it
>>>>> client side
>>>>>
>>>>> On Sunday, 31 March 2019 00:54:23 UTC-7, 黄祥 wrote:
>>>>>>
>>>>>> Backporting SQLFORM, grid and Auth, should not be that complicated,
>>>>>>> although I think we can do better.
>>>>>>>
>>>>>>
>>>>>> sqlform, grid and auth is a great helper to make web2py as rapid
>>>>>> application development, but please consider some of users who want to 
>>>>>> use
>>>>>> another css or js framework.
>>>>>> perhaps just follow the python principle 'Explicit is better than
>>>>>> implicit', something like
>>>>>> sqlform(), sqlform.grid() or form() signature have style='bootstrap',
>>>>>> or class='something' or tag='div|span|table|tr|td'
>>>>>> not sure just an idea
>>>>>> perhaps can stick with the initial idea
>>>>>> ref:
>>>>>> https://groups.google.com/forum/#!msg/web2py/89a846kPeGA/nUpNJB_VCAAJ
>>>>>>
>>>>>> best regards,
>>>>>> stifan
>>>>>>
>>>>> --
>&

Re: [web2py] Custom validator broken in 2.18.4, working in 2.17.2

2019-04-05 Thread Kevin Keller
Could you create a ticket for this please?
https://github.com/web2py/web2py/issues

Thanks!

On Thu, Apr 4, 2019 at 10:52 PM David Manns  wrote:

> The table in question has a field:
>
> Field('Paiddate', 'date', requires = [IS_EMPTY_OR(IS_DATE()),
> IS_EMPTY_OR(IS_MEMBERSHIP_YEAR_END())]),
>
> The custom validator is:
>
> class IS_MEMBERSHIP_YEAR_END(object):
> def __init__(self, error_message='Not a membership year end'):
> self.error_message = error_message
> def __call__(self, value):
> yearend = datetime.date(2018,9,30)
> if value.month==yearend.month and value.day==yearend.day:
> return (value, None)
> return (value, self.error_message)
>
> This works in 2.17.2
>
> I updated my test environment to 2.18.4 and it fails.
>
> On the console I see:
>
> web2py Web Framework
> Created by Massimo Di Pierro, Copyright 2007-2019
> Version 2.18.4-stable+timestamp.2019.03.13.05.27.54
> Database drivers available: sqlite3, imaplib, pyodbc, pymysql
> please visit:
> ('\t', 'http://127.0.0.1:8000/')
> starting browser...
> Traceback (most recent call last):
>   File "C:\Users\David\Google Drive\Oxcamne Archive\Web
> Site\OxCamNE.2.1\gluon\html.py", line 1890, in _validate
> (value, errors) = validator(value)
>   File "C:\Users\David\Google Drive\Oxcamne Archive\Web
> Site\OxCamNE.2.1\gluon\packages\dal\pydal\validators.py", line 144, in
> __call__
> return self.validate(value), None
>   File "C:\Users\David\Google Drive\Oxcamne Archive\Web
> Site\OxCamNE.2.1\gluon\packages\dal\pydal\validators.py", line 2754, in
> validate
> return self.other.validate(value)
> AttributeError: 'IS_MEMBERSHIP_YEAR_END' object has no attribute 'validate'
>
> The ticket shows:
>
> Error ticket for "init" Ticket ID
>
> 127.0.0.1.2019-04-04.16-41-08.0dce185d-d8d2-4d36-9e47-8c82bc1d54f5
>  Validation error, field:Paiddate
>  Version
> web2py™ Version 2.18.4-stable+timestamp.2019.03.13.05.27.54
> Python Python 2.7.14: C:\Python27\python.exe (prefix: C:\Python27)
> Traceback
>
> 1.
> 2.
> 3.
> 4.
> 5.
> 6.
> 7.
> 8.
> 9.
> 10.
> 11.
> 12.
> 13.
> 14.
> 15.
> 16.
> 17.
> 18.
> 19.
> 20.
> 21.
> 22.
> 23.
> 24.
> 25.
> 26.
> 27.
> 28.
> 29.
> 30.
>
> Traceback (most recent call last):
>   File "C:\Users\David\Google Drive\Oxcamne Archive\Web 
> Site\OxCamNE.2.1\gluon\restricted.py", line 219, in restricted
> exec(ccode, environment)
>   File "C:\Users\David\Google Drive\Oxcamne Archive\Web 
> Site\OxCamNE.2.1\applications\init\controllers/default.py", line 1747, in 
> 
>   File "C:\Users\David\Google Drive\Oxcamne Archive\Web 
> Site\OxCamNE.2.1\gluon\globals.py", line 421, in 
> self._caller = lambda f: f()
>   File "C:\Users\David\Google Drive\Oxcamne Archive\Web 
> Site\OxCamNE.2.1\applications\init\models\db.py", line 109, in wrapped_f
> return f(*args)
>   File "C:\Users\David\Google Drive\Oxcamne Archive\Web 
> Site\OxCamNE.2.1\applications\init\controllers/default.py", line 214, in 
> memberform
> deletable = dltbl, onvalidation=setmodified, onaccept=modmember, 
> ondelete=delmember)
>   File "C:\Users\David\Google Drive\Oxcamne Archive\Web 
> Site\OxCamNE.2.1\gluon\tools.py", line 4322, in update
> detect_record_change=self.settings.detect_record_change):
>   File "C:\Users\David\Google Drive\Oxcamne Archive\Web 
> Site\OxCamNE.2.1\gluon\sqlhtml.py", line 1758, in accepts
> **kwargs
>   File "C:\Users\David\Google Drive\Oxcamne Archive\Web 
> Site\OxCamNE.2.1\gluon\html.py", line 2149, in accepts
> status = self._traverse(status, hideerror)
>   File "C:\Users\David\Google Drive\Oxcamne Archive\Web 
> Site\OxCamNE.2.1\gluon\html.py", line 910, in _traverse
> newstatus = c._traverse(status, hideerror) and newstatus
>   File "C:\Users\David\Google Drive\Oxcamne Archive\Web 
> Site\OxCamNE.2.1\gluon\html.py", line 910, in _traverse
> newstatus = c._traverse(status, hideerror) and newstatus
>   File "C:\Users\David\Google Drive\Oxcamne Archive\Web 
> Site\OxCamNE.2.1\gluon\html.py", line 910, in _traverse
> newstatus = c._traverse(status, hideerror) and newstatus
>   File "C:\Users\David\Google Drive\Oxcamne Archive\Web 
> Site\OxCamNE.2.1\gluon\html.py", line 910, in _traverse
> newstatus = c._traverse(status, hideerror) and newstatus
>   File "C:\Users\David\Google Drive\Oxcamne Archive\Web 
> Site\OxCamNE.2.1\gluon\html.py", line 917, in _traverse
> newstatus = self._validate()
>   File "C:\Users\David\Google Drive\Oxcamne Archive\Web 
> Site\OxCamNE.2.1\gluon\html.py", line 1895, in _validate
> raise Exception(msg)
> Exception: Validation error, field:Paiddate  object at 0x04878048>
>
> --
> 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 

[web2py] Re: Validation messages of extra fields in auth_user don't comply with available translations

2019-04-05 Thread Kevin Keller
Wow that must be annoying. 

Did you find any workaround? 

On Thursday, 4 April 2019 21:25:10 UTC+2, João Matos wrote:
>
> When creating extra fields for auth_user, the validation messages for 
> those fields are always in English. They don't comply with the translations 
> available.
>
> This does not happen on the default fields.
>
>
> I added this to db.py
>
>
> auth.settings.extra_fields['auth_user'] = [Field('pagination', 'integer', 
> default=9, label=T('Pagination'), notnull=True, required=True, requires=
> IS_INT_IN_RANGE(5, 51))] 
>
>
> When inserting an invalid value, the returned message is always
>
> Enter an integer between 5 and 50
>>
> even when the web2py language is not English and the languages files have 
> the correct translation available.
>
>
> web2py 2.18.4
> Python 3.7.1 x86
> Firefox 66.0.2 x64
> Windows 7 Pro x64 SP1+all updates
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: New International Telegram Support Group

2019-04-05 Thread Kevin Keller
Good group, really helped me to advance my proeject so much quicker. In 
fact, couldnt have gotten here without them. Thanks!

On Thursday, 4 April 2019 22:40:51 UTC+2, Ari Lion BR Sp wrote:
>
> Hey, Carlos, thanks for having created this group. Now I can solve my 
> questions Live 
>
> :-)
>
>
>
> Em segunda-feira, 25 de março de 2019 18:44:01 UTC-3, Ari Lion BR Sp 
> escreveu:
>>
>> That's great
>>
>> Good live discussions at the Group.
>>
>> Em segunda-feira, 25 de março de 2019 09:20:29 UTC-3, Vlad escreveu:
>>>
>>> Joined!
>>> Very nice & interactive - 
>>> There is some beauty in messenger group interaction vs. traditionally 
>>> organized groups...
>>>
>>> On Tuesday, March 19, 2019 at 2:49:34 PM UTC-4, Ari Lion BR Sp wrote:

 Oh, Great 

 Now I see a new link to this group:
 https://t.me/web2py_world


 Great I joined.
 That's great that Leonel Camara also joined the group!
 Now we can be sure that no doubt we have will be unanswered :-)


 Thanks!


 Em terça-feira, 19 de março de 2019 12:26:09 UTC-3, Carlos Costa 
 escreveu:
>
> we noticied this group has no administrator, so we are moving to a new 
> one, here is the link https://t.me/joinchat/DYZrfBT-bIsVhwLZc1hG8Q
>
> Em terça-feira, 19 de março de 2019 12:14:17 UTC-3, Carlos Costa 
> escreveu:
>>
>> We have had a good experience with the brazilian telegram group 
>> dedicated to to support web2py users.
>>
>> But the english speaking group is not used at.
>>
>> Here is the link to join it: https://t.me/web2py_en
>>
>> Also, here is the link to the Brazilian group (portuguese speaking 
>> and some portunhol allowed too :D ): https://t.me/web2pybrasil
>>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: Error Ticket Includes Sensitive Information

2019-04-04 Thread Kevin Keller
Can errror messags and tickets in production not be restricted to server
log files and disabled to be displayed for users or at least the ticket
itself made inaccessbile to normal users?

On Thu, Apr 4, 2019 at 4:38 PM zm  wrote:

> For what it's worth, I did post to the developer list, however it never
> appeared.  I assume it requires moderator approval or was rejected.
>
> On Tuesday, March 26, 2019 at 9:32:39 PM UTC-5, Anthony wrote:
>>
>> I don't think it's possible, but feel free to get a discussion going on
>> the developers' list
>> .
>> I'm sure a pull request would be welcome once an approach is decided.
>>
>> Anthony
>>
>> On Monday, March 25, 2019 at 1:57:00 PM UTC-4, zm wrote:
>>>
>>> The error tickets created by the framework are great for debugging,
>>> however depending on where a failure can include, they can include very
>>> sensitive information like user ID + password combinations.
>>>
>>> Is it possible to filter certain fields out of the tickets such as user
>>> name / password?  It seems like snapshot could be updated to include
>>> some sort of filter.
>>>
>> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: Newst Trunk Edition (4th April 2019) rocket wont start

2019-04-02 Thread Kevin Keller
Overcame the issue for now using apache and mod_wsgi with self-signed
cert..

But something is definietly wrong with the rocket server at the moment..

On Tue, Apr 2, 2019 at 10:50 AM Kevin Keller  wrote:

> Same on a totally different fresh ubuntu server with python 3.6.. with
> version from github..
>
> On Tuesday, 2 April 2019 10:44:24 UTC+2, Kevin Keller wrote:
>>
>> On no.. it doesnt...
>>
>> On Tuesday, 2 April 2019 10:42:52 UTC+2, Kevin Keller wrote:
>>>
>>> Reverting to the version from the zip file on home page ("For Users")
>>> works..
>>>
>>> On Tuesday, 2 April 2019 10:32:16 UTC+2, Kevin Keller wrote:
>>>>
>>>> Works fine on windows10, python 3.7.1 without ssl and firing it up
>>>> locally..
>>>>
>>>> On Tuesday, 2 April 2019 10:27:46 UTC+2, Kevin Keller wrote:
>>>>>
>>>>> Centos7
>>>>> Python 3.7.1
>>>>>
>>>>> git cloning this repo just now, generating ssl certs and then starting
>>>>> up
>>>>>
>>>>> like this:
>>>>> python3.7 web2py.py -k myapp.key -c myapp.crt -i 0.0.0.0 -p 8000
>>>>>
>>>>> trhows this after punching id admin pass:
>>>>>
>>>>>
>>>>> Exception in thread Thread-2:
>>>>> Traceback (most recent call last):
>>>>>   File "/usr/local/lib/python3.7/threading.py", line 917, in
>>>>> _bootstrap_inner
>>>>> self.run()
>>>>>   File "/home/oracle/Projects/web2py/gluon/rocket.py", line 1268, in
>>>>> run
>>>>> conn = Connection(*conn)
>>>>>   File "/home/oracle/Projects/web2py/gluon/rocket.py", line 105, in
>>>>> __init__
>>>>> self.socket.settimeout(SOCKET_TIMEOUT)
>>>>> OSError: [Errno 9] Bad file descriptor
>>>>>
>>>>> This exception is thrown continously and the browser does not load the
>>>>> web2py welcome page..
>>>>>
>>>> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Newst Trunk Edition (4th April 2019) rocket wont start

2019-04-02 Thread Kevin Keller
Same on a totally different fresh ubuntu server with python 3.6.. with 
version from github.. 

On Tuesday, 2 April 2019 10:44:24 UTC+2, Kevin Keller wrote:
>
> On no.. it doesnt... 
>
> On Tuesday, 2 April 2019 10:42:52 UTC+2, Kevin Keller wrote:
>>
>> Reverting to the version from the zip file on home page ("For Users") 
>> works.. 
>>
>> On Tuesday, 2 April 2019 10:32:16 UTC+2, Kevin Keller wrote:
>>>
>>> Works fine on windows10, python 3.7.1 without ssl and firing it up 
>>> locally.. 
>>>
>>> On Tuesday, 2 April 2019 10:27:46 UTC+2, Kevin Keller wrote:
>>>>
>>>> Centos7
>>>> Python 3.7.1
>>>>
>>>> git cloning this repo just now, generating ssl certs and then starting 
>>>> up 
>>>>
>>>> like this: 
>>>> python3.7 web2py.py -k myapp.key -c myapp.crt -i 0.0.0.0 -p 8000
>>>>
>>>> trhows this after punching id admin pass: 
>>>>
>>>>
>>>> Exception in thread Thread-2:
>>>> Traceback (most recent call last):
>>>>   File "/usr/local/lib/python3.7/threading.py", line 917, in 
>>>> _bootstrap_inner
>>>> self.run()
>>>>   File "/home/oracle/Projects/web2py/gluon/rocket.py", line 1268, in run
>>>> conn = Connection(*conn)
>>>>   File "/home/oracle/Projects/web2py/gluon/rocket.py", line 105, in 
>>>> __init__
>>>> self.socket.settimeout(SOCKET_TIMEOUT)
>>>> OSError: [Errno 9] Bad file descriptor
>>>>
>>>> This exception is thrown continously and the browser does not load the 
>>>> web2py welcome page..  
>>>>
>>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Newst Trunk Edition (4th April 2019) rocket wont start

2019-04-02 Thread Kevin Keller
On no.. it doesnt... 

On Tuesday, 2 April 2019 10:42:52 UTC+2, Kevin Keller wrote:
>
> Reverting to the version from the zip file on home page ("For Users") 
> works.. 
>
> On Tuesday, 2 April 2019 10:32:16 UTC+2, Kevin Keller wrote:
>>
>> Works fine on windows10, python 3.7.1 without ssl and firing it up 
>> locally.. 
>>
>> On Tuesday, 2 April 2019 10:27:46 UTC+2, Kevin Keller wrote:
>>>
>>> Centos7
>>> Python 3.7.1
>>>
>>> git cloning this repo just now, generating ssl certs and then starting 
>>> up 
>>>
>>> like this: 
>>> python3.7 web2py.py -k myapp.key -c myapp.crt -i 0.0.0.0 -p 8000
>>>
>>> trhows this after punching id admin pass: 
>>>
>>>
>>> Exception in thread Thread-2:
>>> Traceback (most recent call last):
>>>   File "/usr/local/lib/python3.7/threading.py", line 917, in 
>>> _bootstrap_inner
>>> self.run()
>>>   File "/home/oracle/Projects/web2py/gluon/rocket.py", line 1268, in run
>>> conn = Connection(*conn)
>>>   File "/home/oracle/Projects/web2py/gluon/rocket.py", line 105, in 
>>> __init__
>>> self.socket.settimeout(SOCKET_TIMEOUT)
>>> OSError: [Errno 9] Bad file descriptor
>>>
>>> This exception is thrown continously and the browser does not load the 
>>> web2py welcome page..  
>>>
>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Newst Trunk Edition (4th April 2019) rocket wont start

2019-04-02 Thread Kevin Keller
Reverting to the version from the zip file on home page ("For Users") 
works.. 

On Tuesday, 2 April 2019 10:32:16 UTC+2, Kevin Keller wrote:
>
> Works fine on windows10, python 3.7.1 without ssl and firing it up 
> locally.. 
>
> On Tuesday, 2 April 2019 10:27:46 UTC+2, Kevin Keller wrote:
>>
>> Centos7
>> Python 3.7.1
>>
>> git cloning this repo just now, generating ssl certs and then starting up 
>>
>> like this: 
>> python3.7 web2py.py -k myapp.key -c myapp.crt -i 0.0.0.0 -p 8000
>>
>> trhows this after punching id admin pass: 
>>
>>
>> Exception in thread Thread-2:
>> Traceback (most recent call last):
>>   File "/usr/local/lib/python3.7/threading.py", line 917, in 
>> _bootstrap_inner
>> self.run()
>>   File "/home/oracle/Projects/web2py/gluon/rocket.py", line 1268, in run
>> conn = Connection(*conn)
>>   File "/home/oracle/Projects/web2py/gluon/rocket.py", line 105, in 
>> __init__
>> self.socket.settimeout(SOCKET_TIMEOUT)
>> OSError: [Errno 9] Bad file descriptor
>>
>> This exception is thrown continously and the browser does not load the 
>> web2py welcome page..  
>>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Newst Trunk Edition (4th April 2019) rocket wont start

2019-04-02 Thread Kevin Keller
Works fine on windows10, python 3.7.1 without ssl and firing it up 
locally.. 

On Tuesday, 2 April 2019 10:27:46 UTC+2, Kevin Keller wrote:
>
> Centos7
> Python 3.7.1
>
> git cloning this repo just now, generating ssl certs and then starting up 
>
> like this: 
> python3.7 web2py.py -k myapp.key -c myapp.crt -i 0.0.0.0 -p 8000
>
> trhows this after punching id admin pass: 
>
>
> Exception in thread Thread-2:
> Traceback (most recent call last):
>   File "/usr/local/lib/python3.7/threading.py", line 917, in 
> _bootstrap_inner
> self.run()
>   File "/home/oracle/Projects/web2py/gluon/rocket.py", line 1268, in run
> conn = Connection(*conn)
>   File "/home/oracle/Projects/web2py/gluon/rocket.py", line 105, in 
> __init__
> self.socket.settimeout(SOCKET_TIMEOUT)
> OSError: [Errno 9] Bad file descriptor
>
> This exception is thrown continously and the browser does not load the 
> web2py welcome page..  
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Newst Trunk Edition (4th April 2019) rocket wont start

2019-04-02 Thread Kevin Keller
Centos7
Python 3.7.1

git cloning this repo just now, generating ssl certs and then starting up 

like this: 
python3.7 web2py.py -k myapp.key -c myapp.crt -i 0.0.0.0 -p 8000

trhows this after punching id admin pass: 


Exception in thread Thread-2:
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/threading.py", line 917, in 
_bootstrap_inner
self.run()
  File "/home/oracle/Projects/web2py/gluon/rocket.py", line 1268, in run
conn = Connection(*conn)
  File "/home/oracle/Projects/web2py/gluon/rocket.py", line 105, in __init__
self.socket.settimeout(SOCKET_TIMEOUT)
OSError: [Errno 9] Bad file descriptor

This exception is thrown continously and the browser does not load the 
web2py welcome page..  

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: web3py again....

2019-04-02 Thread Kevin Keller
Here is a project that generates swagger(openapi) documentation for
flask+sqlalchemy.  https://github.com/thomaxxl/safrs
I was already wondering about changing bottle with flask, but I dont know
if that is heresy now :).

On Tue, Apr 2, 2019 at 9:31 AM Kevin Keller  wrote:

>
> https://editor.swagger.io/?_ga=2.227432986.689200959.1554189909-55439989.1547630410
>
>
> Swagger JSON editor + https://swagger.io/specification/. So one Swagger
> Json file can contain the description of all the endpoints.
>
> On Tue, Apr 2, 2019 at 9:19 AM Kevin Keller  wrote:
>
>> I agree.
>>
>> In fact, the whole client side today should be Javascript and just
>> communicate via REST+JWT (even though in the enerprise space you will also
>> need OAUTH2).
>>
>>  The models need to be exposed via REST easiliy and it should be easy to
>> add auth to routes with JWT. Also the REST endpoints once defined, need to
>> generate openapi(swagger) documents automatically.
>>
>> This is much like the JSON route you wanted to go, but with openapi we
>> would be using an actual standard and do not tie ourselves to one
>> Javascript framework and once specific JSON format.
>>
>>  With that we could use something like this:
>> https://api-platform.com/docs/client-generator/ that generates Vue.js or
>> React.js CRUD pages basted on teh openapi documentation for the REST
>> endpoints.
>>
>> On Tue, Apr 2, 2019 at 8:58 AM Massimo Di Pierro <
>> massimo.dipie...@gmail.com> wrote:
>>
>>> Th problem with SQLFORM is that different CSS libraries require
>>> different HTML stuctures. It is not as simple as selecting a class or div
>>> vs span. In web2py we have code to deal with bootstrap 2 and 3. We apply
>>> both classes. It is horrible. We should move away from generating html
>>> server side for forms. We should pass a json description and generate it
>>> client side
>>>
>>> On Sunday, 31 March 2019 00:54:23 UTC-7, 黄祥 wrote:
>>>>
>>>> Backporting SQLFORM, grid and Auth, should not be that complicated,
>>>>> although I think we can do better.
>>>>>
>>>>
>>>> sqlform, grid and auth is a great helper to make web2py as rapid
>>>> application development, but please consider some of users who want to use
>>>> another css or js framework.
>>>> perhaps just follow the python principle 'Explicit is better than
>>>> implicit', something like
>>>> sqlform(), sqlform.grid() or form() signature have style='bootstrap',
>>>> or class='something' or tag='div|span|table|tr|td'
>>>> not sure just an idea
>>>> perhaps can stick with the initial idea
>>>> ref:
>>>> https://groups.google.com/forum/#!msg/web2py/89a846kPeGA/nUpNJB_VCAAJ
>>>>
>>>> best regards,
>>>> stifan
>>>>
>>> --
>>> Resources:
>>> - http://web2py.com
>>> - http://web2py.com/book (Documentation)
>>> - http://github.com/web2py/web2py (Source code)
>>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>>> ---
>>> You received this message because you are subscribed to the Google
>>> Groups "web2py-users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to web2py+unsubscr...@googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: web3py again....

2019-04-02 Thread Kevin Keller
https://editor.swagger.io/?_ga=2.227432986.689200959.1554189909-55439989.1547630410


Swagger JSON editor + https://swagger.io/specification/. So one Swagger
Json file can contain the description of all the endpoints.

On Tue, Apr 2, 2019 at 9:19 AM Kevin Keller  wrote:

> I agree.
>
> In fact, the whole client side today should be Javascript and just
> communicate via REST+JWT (even though in the enerprise space you will also
> need OAUTH2).
>
>  The models need to be exposed via REST easiliy and it should be easy to
> add auth to routes with JWT. Also the REST endpoints once defined, need to
> generate openapi(swagger) documents automatically.
>
> This is much like the JSON route you wanted to go, but with openapi we
> would be using an actual standard and do not tie ourselves to one
> Javascript framework and once specific JSON format.
>
>  With that we could use something like this:
> https://api-platform.com/docs/client-generator/ that generates Vue.js or
> React.js CRUD pages basted on teh openapi documentation for the REST
> endpoints.
>
> On Tue, Apr 2, 2019 at 8:58 AM Massimo Di Pierro <
> massimo.dipie...@gmail.com> wrote:
>
>> Th problem with SQLFORM is that different CSS libraries require different
>> HTML stuctures. It is not as simple as selecting a class or div vs span. In
>> web2py we have code to deal with bootstrap 2 and 3. We apply both classes.
>> It is horrible. We should move away from generating html server side for
>> forms. We should pass a json description and generate it client side
>>
>> On Sunday, 31 March 2019 00:54:23 UTC-7, 黄祥 wrote:
>>>
>>> Backporting SQLFORM, grid and Auth, should not be that complicated,
>>>> although I think we can do better.
>>>>
>>>
>>> sqlform, grid and auth is a great helper to make web2py as rapid
>>> application development, but please consider some of users who want to use
>>> another css or js framework.
>>> perhaps just follow the python principle 'Explicit is better than
>>> implicit', something like
>>> sqlform(), sqlform.grid() or form() signature have style='bootstrap', or
>>> class='something' or tag='div|span|table|tr|td'
>>> not sure just an idea
>>> perhaps can stick with the initial idea
>>> ref:
>>> https://groups.google.com/forum/#!msg/web2py/89a846kPeGA/nUpNJB_VCAAJ
>>>
>>> best regards,
>>> stifan
>>>
>> --
>> Resources:
>> - http://web2py.com
>> - http://web2py.com/book (Documentation)
>> - http://github.com/web2py/web2py (Source code)
>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "web2py-users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to web2py+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: web3py again....

2019-04-02 Thread Kevin Keller
I agree.

In fact, the whole client side today should be Javascript and just
communicate via REST+JWT (even though in the enerprise space you will also
need OAUTH2).

 The models need to be exposed via REST easiliy and it should be easy to
add auth to routes with JWT. Also the REST endpoints once defined, need to
generate openapi(swagger) documents automatically.

This is much like the JSON route you wanted to go, but with openapi we
would be using an actual standard and do not tie ourselves to one
Javascript framework and once specific JSON format.

 With that we could use something like this:
https://api-platform.com/docs/client-generator/ that generates Vue.js or
React.js CRUD pages basted on teh openapi documentation for the REST
endpoints.

On Tue, Apr 2, 2019 at 8:58 AM Massimo Di Pierro 
wrote:

> Th problem with SQLFORM is that different CSS libraries require different
> HTML stuctures. It is not as simple as selecting a class or div vs span. In
> web2py we have code to deal with bootstrap 2 and 3. We apply both classes.
> It is horrible. We should move away from generating html server side for
> forms. We should pass a json description and generate it client side
>
> On Sunday, 31 March 2019 00:54:23 UTC-7, 黄祥 wrote:
>>
>> Backporting SQLFORM, grid and Auth, should not be that complicated,
>>> although I think we can do better.
>>>
>>
>> sqlform, grid and auth is a great helper to make web2py as rapid
>> application development, but please consider some of users who want to use
>> another css or js framework.
>> perhaps just follow the python principle 'Explicit is better than
>> implicit', something like
>> sqlform(), sqlform.grid() or form() signature have style='bootstrap', or
>> class='something' or tag='div|span|table|tr|td'
>> not sure just an idea
>> perhaps can stick with the initial idea
>> ref:
>> https://groups.google.com/forum/#!msg/web2py/89a846kPeGA/nUpNJB_VCAAJ
>>
>> best regards,
>> stifan
>>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: web3py again....

2019-03-28 Thread Kevin Keller
I like the general direction of it.
Auth and sqlform backported would of course be great.

With bottle in the middle we can tap into the bottle community extensions
but also gain extra flexibility..

Combined with web2py sqlform and Auth etc could be a real winner

On Fri, 29 Mar 2019, 02:46 Joe Barnhart,  wrote:

> I agree that back porting web2py code should be straightforward (after
> all, it's not rocket science :-D).  But maybe we should revisit those
> modules and pare them down to minimalist proportions.  I really need Auth,
> complete with user roles and groups, but there's probably a better way to
> minimize/abstract and provide a growth path.
>
> Plus, with py3 and web2py in hand, its not like there's a fire that needs
> putting out.
>
> -- Joe
>
>
> On Thursday, March 28, 2019 at 2:16:15 AM UTC-7, Massimo Di Pierro wrote:
>>
>> I know this comes up once in a while but ...
>>
>> https://github.com/web2py/web3py
>>
>> what do you think?
>>
>> It is very preliminary but I will have an admin soon.
>> Backporting SQLFORM, grid and Auth, should not be that complicated,
>> although I think we can do better.
>>
>> Massimo
>>
>> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: Web3py reboot

2019-03-18 Thread Kevin Keller
Just for reference: https://www.jhipster.tech/

On Mon, Mar 18, 2019 at 9:59 AM Kevin Keller  wrote:

> Well, if you want to have something different, we would probably need to
> look into things like scaffolding of a web3py REST backend with oauth2+jwt
> security for the endpoints plus automatic openapi (swagger)
> documentation/files and a frontend based i,.e. on Vue.js or React/Angular.
> Somewhat similiar to JHipster.
> I suppose the decoupling of frontend javasript and backend python code is
> where the development of web pages is headed.
> That would also enable easy to create mobile applications with a web2py
> backend.
>
> Other ideas are of course to develop the low code approach further, to
> have something like Oracle APEX https://apex.oracle.com/en/ or
> https://anvil.works/, which is a low code environment purely based on
> python
> including the frontend.
> While it uses sculpt which is only python2 comptabile, we could look and
> transcrypt if we had a visual environment were poeple can drag and drop
> elements and code their behaviour in python via transcrypt.
> https://www.transcrypt.org/
>
> So I dont know where you thoughts were headed, but it is towards the
> future, then these are my 2 cents.
> Possibly low hanging fruit is to focus on easy REST API with automatic
> openapi documentation and then go from there.
>
> But if we are there, I suppose we are already at Web4Py, which is even a
> better sounding name.
>
> Web3Py, just to regain more popularity, but making it clear that web2py is
> fully python3 compatible and increase stability by further code reviews by
> more coders would be a good first step I thought.
>
>
>
>
>
> On Mon, Mar 18, 2019 at 3:47 AM Massimo Di Pierro <
> massimo.dipie...@gmail.com> wrote:
>
>> I think web3py should be something a little different, not just web2py
>> for python3.
>>
>>
>>
>> On Sunday, 17 March 2019 05:42:16 UTC-7, Kevin Keller wrote:
>>>
>>> Hey,
>>>
>>> So I was wondering today what you guys would think about the idea to
>>> rename web2py to Web3py, once it reaches a level of maturity that would be
>>> able to justify the rename and a reboot.
>>>
>>> That would also mean to update the web page and various resources.
>>>
>>> The reason is simple :
>>>
>>> It seems that since  around 2016 python 3 has seen a major increase in
>>> adoption while web2py adoption decreased due to being perceived as python2
>>> only framework, which at the time was certainly true.
>>>
>>> While it's not true anymore, I think the perception of being a python2
>>> only framework combined with outdated resources doesn't help adoption.
>>>
>>> While sacrificing the established name is certainly not great, I think
>>> the benefits of a reboot with a name change to emphasize the python3
>>> compatibility would far outweigh any drawback.
>>> Python2 compatibility that is maintained would however seen as a plus
>>> and a major differentiator to other frameworks that dropped python2
>>> support.
>>>
>>> What do you think?
>>>
>>> --
>> Resources:
>> - http://web2py.com
>> - http://web2py.com/book (Documentation)
>> - http://github.com/web2py/web2py (Source code)
>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "web2py-users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to web2py+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: Web3py reboot

2019-03-18 Thread Kevin Keller
Well, if you want to have something different, we would probably need to
look into things like scaffolding of a web3py REST backend with oauth2+jwt
security for the endpoints plus automatic openapi (swagger)
documentation/files and a frontend based i,.e. on Vue.js or React/Angular.
Somewhat similiar to JHipster.
I suppose the decoupling of frontend javasript and backend python code is
where the development of web pages is headed.
That would also enable easy to create mobile applications with a web2py
backend.

Other ideas are of course to develop the low code approach further, to have
something like Oracle APEX https://apex.oracle.com/en/ or
https://anvil.works/, which is a low code environment purely based on
python
including the frontend.
While it uses sculpt which is only python2 comptabile, we could look and
transcrypt if we had a visual environment were poeple can drag and drop
elements and code their behaviour in python via transcrypt.
https://www.transcrypt.org/

So I dont know where you thoughts were headed, but it is towards the
future, then these are my 2 cents.
Possibly low hanging fruit is to focus on easy REST API with automatic
openapi documentation and then go from there.

But if we are there, I suppose we are already at Web4Py, which is even a
better sounding name.

Web3Py, just to regain more popularity, but making it clear that web2py is
fully python3 compatible and increase stability by further code reviews by
more coders would be a good first step I thought.





On Mon, Mar 18, 2019 at 3:47 AM Massimo Di Pierro <
massimo.dipie...@gmail.com> wrote:

> I think web3py should be something a little different, not just web2py for
> python3.
>
>
>
> On Sunday, 17 March 2019 05:42:16 UTC-7, Kevin Keller wrote:
>>
>> Hey,
>>
>> So I was wondering today what you guys would think about the idea to
>> rename web2py to Web3py, once it reaches a level of maturity that would be
>> able to justify the rename and a reboot.
>>
>> That would also mean to update the web page and various resources.
>>
>> The reason is simple :
>>
>> It seems that since  around 2016 python 3 has seen a major increase in
>> adoption while web2py adoption decreased due to being perceived as python2
>> only framework, which at the time was certainly true.
>>
>> While it's not true anymore, I think the perception of being a python2
>> only framework combined with outdated resources doesn't help adoption.
>>
>> While sacrificing the established name is certainly not great, I think
>> the benefits of a reboot with a name change to emphasize the python3
>> compatibility would far outweigh any drawback.
>> Python2 compatibility that is maintained would however seen as a plus and
>> a major differentiator to other frameworks that dropped python2 support.
>>
>> What do you think?
>>
>> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Web3py reboot

2019-03-17 Thread Kevin Keller
Hey,

So I was wondering today what you guys would think about the idea to rename 
web2py to Web3py, once it reaches a level of maturity that would be able to 
justify the rename and a reboot.

That would also mean to update the web page and various resources. 

The reason is simple :

It seems that since  around 2016 python 3 has seen a major increase in adoption 
while web2py adoption decreased due to being perceived as python2 only 
framework, which at the time was certainly true.

While it's not true anymore, I think the perception of being a python2 only 
framework combined with outdated resources doesn't help adoption.

While sacrificing the established name is certainly not great, I think the 
benefits of a reboot with a name change to emphasize the python3 compatibility 
would far outweigh any drawback.
Python2 compatibility that is maintained would however seen as a plus and a 
major differentiator to other frameworks that dropped python2 support. 



What do you think? 

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] error 'module' object has no attribute 'pbkdf2_hmac' when trying to add user (Ver 2.18.4)

2019-03-15 Thread Kevin Keller
Can you also test it with python3 please?

On Fri, Mar 15, 2019 at 5:11 PM Stephan  wrote:

> Hello there,
>
>
> when trying to add a user in the empty user table via appadmin, I get this
> error: *'module' object has no attribute 'pbkdf2_hmac'*
> Seems to be related to password encryption?
>
>
> Function argument list
>
> (data='!xb2qwtze', salt='b2dfc4f426ee1bbd', iterations=1000, keylen=20,
> hashfunc=)
> Code listing
>
> 2781.
> 2782.
> 2783.
> 2784.
> 2785.
> 2786.
> 2787.
> 2788.
> 2789.
> 2790.
>
> return v
>
>
> def pbkdf2_hex(data, salt, iterations=1000, keylen=24, hashfunc=None):
> hashfunc = hashfunc or sha1
> hmac = hashlib.pbkdf2_hmac(hashfunc().name, to_bytes(data),
>to_bytes(salt), iterations, keylen)
> return binascii.hexlify(hmac)
>
> Variables
> global hmac 
> salt 'b2dfc4f426ee1bbd'
> data '!xb2qwtze'
> hashlib.pbkdf2_hmac undefined
> ).name undefined
> global hashlib 
> iterations 1000
> global to_bytes 
> hashfunc 
> keylen 20
>
>
>
>  'module' object has no attribute
> 'pbkdf2_hmac'Version
> web2py™ Version 2.18.4-stable+timestamp.2019.03.13.05.27.54
> Python Python 2.7.6: /usr/local/bin/uwsgi (prefix: /usr)Traceback
>
> 1.
> 2.
> 3.
> 4.
> 5.
> 6.
> 7.
> 8.
> 9.
> 10.
> 11.
> 12.
> 13.
> 14.
> 15.
> 16.
> 17.
> 18.
> 19.
> 20.
> 21.
> 22.
> 23.
> 24.
> 25.
> 26.
> 27.
> 28.
> 29.
> 30.
> 31.
> 32.
> 33.
> 34.
> 35.
> 36.
> 37.
> 38.
>
> Traceback (most recent call last):
>   File "/home/rexwuff/web2py/gluon/restricted.py", line 219, in restricted
> exec(ccode, environment)
>   File "/home/rexwuff/web2py/applications/babsi/controllers/appadmin.py" 
> ,
>  line 674, in 
>   File "/home/rexwuff/web2py/gluon/globals.py", line 421, in 
> self._caller = lambda f: f()
>   File "/home/rexwuff/web2py/applications/babsi/controllers/appadmin.py" 
> ,
>  line 154, in insert
> if form.accepts(request.vars, session):
>   File "/home/rexwuff/web2py/gluon/sqlhtml.py", line 1962, in accepts
> self.vars.id = self.table.insert(**fields)
>   File "/home/rexwuff/web2py/gluon/packages/dal/pydal/objects.py", line 754, 
> in insert
> ret = self._db._adapter.insert(self, row.op_values())
>   File "/home/rexwuff/web2py/gluon/packages/dal/pydal/adapters/base.py", line 
> 480, in insert
> query = self._insert(table, fields)
>   File "/home/rexwuff/web2py/gluon/packages/dal/pydal/adapters/base.py", line 
> 476, in _insert
> ','.join(self.expand(v, f.type) for f, v in fields))
>   File "/home/rexwuff/web2py/gluon/packages/dal/pydal/adapters/base.py", line 
> 476, in 
> ','.join(self.expand(v, f.type) for f, v in fields))
>   File "/home/rexwuff/web2py/gluon/packages/dal/pydal/adapters/base.py", line 
> 445, in _expand
> rv = self.represent(expression, field_type)
>   File "/home/rexwuff/web2py/gluon/packages/dal/pydal/adapters/base.py", line 
> 382, in represent
> return super(SQLAdapter, self).represent(obj, field_type)
>   File "/home/rexwuff/web2py/gluon/packages/dal/pydal/adapters/base.py", line 
> 336, in represent
> return self.representer.represent(obj, field_type)
>   File 
> "/home/rexwuff/web2py/gluon/packages/dal/pydal/representers/__init__.py", 
> line 251, in represent
> rv = self.get_representer_for_type(field_type)(rv, field_type)
>   File 
> "/home/rexwuff/web2py/gluon/packages/dal/pydal/representers/__init__.py", 
> line 209, in _default
> return self.adapt(value)
>   File 
> "/home/rexwuff/web2py/gluon/packages/dal/pydal/representers/__init__.py", 
> line 227, in adapt
> value = str(value)
>   File "/home/rexwuff/web2py/gluon/packages/dal/pydal/validators.py", line 
> 2880, in __str__
> hashed = simple_hash(self.password, key, salt, digest_alg)
>   File "/home/rexwuff/web2py/gluon/packages/dal/pydal/validators.py", line 
> 2803, in simple_hash
> int(keylen), get_digest(alg)))
>   File "/home/rexwuff/web2py/gluon/packages/dal/pydal/validators.py", line 
> 2786, in pbkdf2_hex
> hmac = hashlib.pbkdf2_hmac(hashfunc().name, to_bytes(data),
> AttributeError: 'module' object has no attribute 'pbkdf2_hmac'
>
>
> Thanks for your help,
>
> Stephan
>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 

Re: [web2py] Web2py Windows edition with 3.x Interpreter

2019-03-12 Thread Kevin Keller
Whats the problem with pydal John?

On Tue, Mar 12, 2019 at 5:37 PM Jitun John  wrote:

> Apologies for the delay...
> I think my program has issues with new version of pydal 19.02, while it
> works fine on pydal 18.08
>
> Thanks Nico for all the hard work.
> I will test and let you know soon.
>
>
> On Sunday, March 3, 2019 at 4:54:38 PM UTC+5:30, Nico Zanferrari wrote:
>>
>> Good morning!
>>
>> I'm proud to say that I've succeeded in building the Windows 64 bit
>> binary with python 3.7.2 using pyinstaller !  Grab it from
>> https://github.com/nicozanf/web2py-pyinstaller
>>
>> There are some little gothas, but it seems to work fine:
>> - in the console I've got many errors like
>> 'ERROR:Rocket.Errors.Thread-2:Tried to send "500 Server Error" to client
>> but received socket error'. They disappear as soon as I've disabled IPv6
>> and rebooted. There are users that report also to fix similar problems by
>> adding the hostname on the hosts file
>> - psycopg2 is placed in a folder by itself, instead than in the root
>> folder
>> - in the currently official binary build (with pyhton 2.7) there are also
>> two binaries: web2py_no_console.exe and web2py_on_gevent.exe. They don't
>> run correctly, and don't seem to be so important for me so I've decided to
>> skip their generation.
>> - Macintosh compatibility is needed, but I cannot work on it
>>
>> Please, help with testing it! I'll make a PR on the official web2py
>> repository after some feedback.
>>
>> Cheers,
>> Nico
>>
>> Il giorno mer 27 feb 2019 alle ore 12:03 Nico Zanferrari <
>> nico...@gmail.com> ha scritto:
>>
>>> Hi,
>>>
>>> this is a big problem also from my point of view and I've already opened 
>>> issue
>>> 2027  . However it's not
>>> so easy to achieve this goal, because you've to switch to 3.x + go 64 bit +
>>> change the *freezer* program (py2exe and bbfreeze do not work with
>>> python >= 3.5). I'm playing with pyinstaller, but I'm not promising
>>> anything. And also a binary Mac version is needed (I only have a Win box),
>>> plus testing everything.
>>>
>>> Cheers,
>>> Nico
>>>
>>> Il giorno mer 27 feb 2019 alle ore 11:45 elisha bere 
>>> ha scritto:
>>>
 Hie,

 Is it possible to change from 2.7 to 3.x in my web2py app

 On 17 Feb 2019 20:57, "Jitun John"  wrote:

> "It requires Python 2.6 (no more supported), Python 2.7 (stable) or
> Python 3.5+ (*recommended for new projects*) already installed on
> your system.
> There are also *binary packages for Windows* and Mac OS X.* They
> include the Python 2.7 interpreter* so you do not need to have it
> pre-installed."
>
> Sorry for my ignorance, I am assuming "Python 2.7 interpreter" as
> "python27.dll" and "pywintypes27.dll" files.
>
> I recently moved my app from 2.x to 3.x using PyCharm IDE and the app
> works fine when using IDE on 3.7 python.
> But when I try to compile it to .exe (using .iss file + hstart.exe), I
> cant use the existing web2py_win.zip file.
>
> Gives me " unsupported pickle protocol:
> 3"
>
> As we are recommending new projects on 3.x, Is it possible for the
> next version to have a 3.x interpreter ?
> or if we have a workaround, I am happy to try it.
>
> 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+un...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>
 --
 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.
 For more options, visit https://groups.google.com/d/optout.

>>> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py 

[web2py] OAuth2 Provider for Web2py

2019-03-09 Thread Kevin Keller
Would anyone know how I can use web2py as an oauth2 provider?

I would like to use Oracle Jet as frontend and web2py as backend via building a 
rest API.

Oracle Jet supports OAuth2 natively to easily create CRUD models that are 
protected with Oauth2.

Otherwise I would need to create a rest call for each of the crud operations 
for each model manually and protect each API call with I. E. Jwt token and 
web2py Auth.

I have seen an old half implemented oauth2 provider app on github, but it seems 
unmaintained for years. 

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: Poweredby error

2019-03-08 Thread Kevin Keller
Hey Daniel,

we need a bit more details to be able to see what is going on.

We can not see what the ticket text says from the link that you posted.

Please share the full traceback.
Give us a glimbs what you want to achieve and what you have already done.
Which models/functions are doing the main part of your app?

Also which web2py version, os, python version etc do you use?

Thanks!

On Fri, Mar 8, 2019 at 5:52 PM Daniel Guilhermino <
danielguilherm...@gmail.com> wrote:

>  Anyone?
>
> Em quinta-feira, 28 de fevereiro de 2019 09:42:56 UTC-3, Daniel
> Guilhermino escreveu:
>>
>> Hi,
>>
>> I've just tried to submit an new application made with web2py and
>> integrated with Dialogflow, but the following error was show:
>>
>>
>> Internal errorTicket issued:
>> poweredby/191.162.178.30.2019-02-28.12-36-03.22ce450a-64b7-4832-8d08-750e16ce25c2
>> 
>>
>> Best 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.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: web2py 2.18.3 is OUT

2019-03-04 Thread Kevin Keller
Just tested it.. works fine now. 

Your fix works. 

Thanks heaps!


On Monday, 4 March 2019 18:45:27 UTC+1, Leonel Câmara wrote:
>
> Kevin I didn't test that, but this fix should indeed fix auth messages as 
> well since they're also LazyT objects that go into session.flash
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: web2py 2.18.3 is OUT

2019-03-04 Thread Kevin Keller
ahh it does fix it.. I applied your fix wrong.. 

Thanks!!!



On Monday, 4 March 2019 18:40:08 UTC+1, Kevin Keller wrote:
>
> Create a sample app i.e. with the wizard or create a page that needs login 
> with the inbuild login form and try to login. 
> The flash message will have the "b" in front off it.. 
>
> Your fix may address the problem with the other flash messages, but not 
> with the messages from the authapi.py
>
> On Monday, 4 March 2019 18:13:33 UTC+1, Leonel Câmara wrote:
>>
>> The only way I could reproduce the b' issue was by putting something in 
>> the session that was being translated like this:
>>
>> session.flash = T("Hello World")
>>
>> I've fixed that particular case:
>>
>> https://github.com/web2py/web2py/pull/2127
>>
>> I can't reproduce the b' problem you guys are having in any other way, so 
>> if it still happens please tell me how to make it happen.
>>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: web2py 2.18.3 is OUT

2019-03-04 Thread Kevin Keller
Create a sample app i.e. with the wizard or create a page that needs login 
with the inbuild login form and try to login. 
The flash message will have the "b" in front off it.. 

Your fix may address the problem with the other flash messages, but not 
with the messages from the authapi.py

On Monday, 4 March 2019 18:13:33 UTC+1, Leonel Câmara wrote:
>
> The only way I could reproduce the b' issue was by putting something in 
> the session that was being translated like this:
>
> session.flash = T("Hello World")
>
> I've fixed that particular case:
>
> https://github.com/web2py/web2py/pull/2127
>
> I can't reproduce the b' problem you guys are having in any other way, so 
> if it still happens please tell me how to make it happen.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: web2py 2.18.3 is OUT

2019-03-04 Thread Kevin Keller
Thanks! 

Its so cool seeing this moving along so quickly. 

There is one thing about this release that is still bothering me, which I 
tried to fix myself, but to no avail. 
The "b" that is showing in the flash messages. 
See screenshot. 

and here: https://github.com/web2py/web2py/issues/2119
and here: https://github.com/web2py/web2py/issues/2110

Seems like the xmlescape function from yatl is not taking care of the 
escaping as well as the local_html_escape function did. 

I have been fiddling around with it and Joao was providing a way to revert 
the files affected to 2.18.1 to overcome this for now. 
But it would be great to have it fixed. 

I just dont know how. 

Could you help us with this please? 



On Monday, 4 March 2019 00:30:43 UTC+1, Massimo Di Pierro wrote:
>
> we fixed a number of small issues. please check it out.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: Web2py version 2.18.2 Communications Error when in Admin.

2019-03-03 Thread Kevin Keller
Ricardos change fixes it: 

 main.py in gluon. The urllib_quote is not recognized, i change by 
urllib2.quote

On Sunday, 3 March 2019 11:22:37 UTC+1, Lovedie JC wrote:
>
> Same to me and I have to save se3times and even merge the documents for it 
> ot finally save.
> Regards 
>
> On Sun, 3 Mar 2019, 13:20 Kevin Keller > 
> wrote:
>
>> The same here with python 3.7.1 on Windows10 latest Web2py from git from 
>> this morning. 
>> Pressing the save button twice brings up the merge dialogue, which does 
>> the trick for me for now.. 
>>
>> On Tuesday, 26 February 2019 19:25:32 UTC+1, John McMaster wrote:
>>>
>>> Just installed web2py version 2.18.2 and now I get a communications 
>>> error when I save changes in an app.
>>>
>>> I get nothing in the error logs. 
>>>
>>> The apps run but when I go to edit them and click the save button at the 
>>> top of the lefthand page I  get a red communications error in the field to 
>>> the right of "Last saved on:"  <<< here that looks like this:
>>> Save file: [save disk icon] Saved file hash:  Last saved on:  toggle 
>>> breakpoint
>>>
>>>
>>> I have restarted the uwsgi and checked the logs only to see that all has 
>>> run cleanly.  I was getting a message that "probable another instance of 
>>> uWSGI is running on the same address (127.0.0.1:9) where 9 is 
>>> the port number assigned.
>>> I killed all instances and restarted the uWSGI and all is clean.
>>>
>>> However I still get an comunications error.
>>>
>>> Any ideas as to where to look for issues / configuration problems?
>>>
>>> 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+un...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


  1   2   >