[web2py] Dashboard library for Web2py performance/recommendation python vs. js

2020-11-17 Thread Jon Subscripted
Hi everyone,
I need to implement a dashboard and some charts in my webapp. And honestly
I'm a little bit lost and overwhelmed.

>From a Web2py perspective which is the best approach?
a) a python based solution (e.g. plotly)
b) a JS based solution

My app is hosted in Pythonanywhere.

Is there any recommended dashboard and chart library for web2py?
Thanks, Jon.


Libre
de virus. www.avast.com

<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the 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/CAK8tz30J5HwWqY8au9YzxTNd%3Dz9E3N%3D1xkdiM9ei1-XBDRsMJQ%40mail.gmail.com.


Re: [web2py] Dashboard library for Web2py performance/recommendation python vs. js

2020-11-17 Thread Christian Varas
I would recommend to use a client side chart (JavaScript) because is less
load to the server. The one that I use often is ChartJS is easy to
configure and really nice looking.
For a dashboard I use this 2 templates:
Paper dashboard and AdminLTE.

Cheers.
Chris.

El El mar, 17 de nov. de 2020 a la(s) 05:47, Jon Subscripted <
jonsubscripti...@gmail.com> escribió:

> Hi everyone,
> I need to implement a dashboard and some charts in my webapp. And honestly
> I'm a little bit lost and overwhelmed.
>
> From a Web2py perspective which is the best approach?
> a) a python based solution (e.g. plotly)
> b) a JS based solution
>
> My app is hosted in Pythonanywhere.
>
> Is there any recommended dashboard and chart library for web2py?
> Thanks, Jon.
>
>
> 
>  Libre
> de virus. www.avast.com
> 
> <#m_2342288305175885681_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the 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/CAK8tz30J5HwWqY8au9YzxTNd%3Dz9E3N%3D1xkdiM9ei1-XBDRsMJQ%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/CA%2Bs%2BuJtKHC4smZzfA0u0mMdq95Xvw48sWD60%2BfYwpY03MzdyDw%40mail.gmail.com.


[web2py] Login via an link/URL

2020-11-17 Thread Kenneth
Hi,

I tried searching the discussions but could not find anything like this 
being discussed. 

I'm looking into having users login into my app via an link/URL they 
receive via email. They just get an link no separate username and password. 
When the link is accessed they are logged in normally. The link would look 
like something like this: my.website.com/longhash4324kljhasdfasd9f87ads

Does web2py already contain this function?


Kenneth

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the 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/e8102d90-88c8-4a4c-abcb-96ba7aa54cddn%40googlegroups.com.


Re: [web2py] Login via an link/URL

2020-11-17 Thread AGRogers
Hi Kenneth

The following are guesses

1. I have never seen anything that is remotely similar to this in web2py.
But i like the idea.

2. Maybe the 'impersonate' option might work. Someone how log in as a user
whose account details you know and then impersonate the user identified in
the link. Info on that here:
http://web2py.com/books/default/chapter/29/09/access-control#Authentication.
Not sure how you log in as the known user though.

3. Somewhat related to your question is a challenge i want to address: how
can i enable logging in via pictures? My app is for young kids and a great
way for 5 year olds is to link their profile image with a password image.
I thought that would be easy to make but after thinking about your question
I suspect it wont be. It's kind of the same problem - logging in for
someone else.

Cheers
Andrew
___
*www.TenOutOfTen.org* 
rogers...@gmail.com
(+95) 09 250018669 (Myanmar)



On Wed, 18 Nov 2020 at 08:24, Kenneth  wrote:

> Hi,
>
> I tried searching the discussions but could not find anything like this
> being discussed.
>
> I'm looking into having users login into my app via an link/URL they
> receive via email. They just get an link no separate username and password.
> When the link is accessed they are logged in normally. The link would look
> like something like this: my.website.com/longhash4324kljhasdfasd9f87ads
>
> Does web2py already contain this function?
>
>
> Kenneth
>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the 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/e8102d90-88c8-4a4c-abcb-96ba7aa54cddn%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/CACWMBMOQpQchoc6UXc_i-bz-wyX9LuAOC0Nf_8dmpig86650OA%40mail.gmail.com.


Re: [web2py] Where to find Alert/Flash messages

2020-11-17 Thread AGRogers
You can see error tickets from the Admin module (screenshot below). I
believe they are stored on the filesystem, not in a table. I have never
looked.

Re Flash messages, unless they are generated from error tickets, i doubt
they are stored anywhere.

I have a function that logs errors (and anything else I want) in an
EventLog table. You are probably catching all errors and trying to handle
them gracefully so its not hard to grab the error that was raised at that
point. Trying to extract the error from the exception took me a little
looking for. My code for that is below.

Also, there is a logging feature in web2py.
http://web2py.com/books/default/chapter/29/04/the-core?search=logger#Logging


Maybe something there helps?

[image: image.png]

def MyFunction:
try:
#My code

except Exception as e:
Result = Public.LogError(pyFileName, e, I, ReturnJson = False)


Public Module
-
from datetime import datetime
import inspect
import sys
import simplejson as json

def LogError(FileName, e=None, ExtraInfo = "", LogType = 'Error',
ReturnJson=False, FlashError = False):

NOW = datetime.now()
curframe = inspect.currentframe()
ErrFunction = inspect.getouterframes(curframe, 2)
Msg = sys.exc_info()[0]
LogFunction = "%s < %s < %s [%s]" %(ErrFunction[1].function,
ErrFunction[2].function, ErrFunction[3].function, FileName)

if e:
if hasattr(e, 'message'):
Msg = "%s [Sys: %s]" % (e.message, Msg)
#print(e.message)
else:
#print(e)
Msg = "%s [Sys: %s]" % (e, Msg)

if not Msg: Msg=''

print('--- ERROR
---')
print("%s: FUNC: %s. ERR: %s. %s" % (str(NOW)[11:19], LogFunction, Msg,
ExtraInfo))
Common.AddLogEntry(LogType=LogType, LogFunction = LogFunction,
LogMessage = '%s %s' % (Msg, ExtraInfo))


print('-')

result = ("%s: FUNC: %s. ERR: %s. %s" % (str(NOW)[11:19], LogFunction,
Msg, ExtraInfo))

message = result
if 'ERR: UNIQUE constraint failed' in message:
startat = message.find("ERR: UNIQUE")
char1 = ":"
char2 = "["
table_info = message[message.find(char1,startat) + 1:
message.find(char2,startat)]
message = f'There is already a record in the database just like
this one. We cannot add another. ({table_info})'

if FlashError: current.response.flash = XML("Error: " + message +
current.response.flash)

result = dict(Success = False, Message = message)
if ReturnJson:
result = json.dumps(result)

logger = logging.getLogger("web2py.app.myapp")
logger.setLevel(logging.DEBUG)
logger.error(message)

return result


___
*www.TenOutOfTen.org* 
rogers...@gmail.com
(+95) 09 250018669 (Myanmar)




On Mon, 16 Nov 2020 at 20:49, Brennie Standy 
wrote:

> I have a ticket where our client wishes to see a list of all
> flash/alert/error messages, including anything from "Logged in" to our own
> customized error messages set by the previous developer. Where in the app
> can I find this list? Standard global search is not proving useful. 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/b447d3c3-987d-4d59-a790-2dacf04f2fe6n%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/CACWMBMPttp_K25bZR9XNau25TsS9HaOiJOSQoyfXZJdqgN9kpw%40mail.gmail.com.


Re: [web2py] Dashboard library for Web2py performance/recommendation python vs. js

2020-11-17 Thread Jon Subscripted
Thanks for your advice Christian :-)


Libre
de virus. www.avast.com

<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

On Tue, Nov 17, 2020 at 3:28 PM Christian Varas 
wrote:

> I would recommend to use a client side chart (JavaScript) because is less
> load to the server. The one that I use often is ChartJS is easy to
> configure and really nice looking.
> For a dashboard I use this 2 templates:
> Paper dashboard and AdminLTE.
>
> Cheers.
> Chris.
>
> El El mar, 17 de nov. de 2020 a la(s) 05:47, Jon Subscripted <
> jonsubscripti...@gmail.com> escribió:
>
>> Hi everyone,
>> I need to implement a dashboard and some charts in my webapp. And
>> honestly I'm a little bit lost and overwhelmed.
>>
>> From a Web2py perspective which is the best approach?
>> a) a python based solution (e.g. plotly)
>> b) a JS based solution
>>
>> My app is hosted in Pythonanywhere.
>>
>> Is there any recommended dashboard and chart library for web2py?
>> Thanks, Jon.
>>
>>
>> 
>>  Libre
>> de virus. www.avast.com
>> 
>>
>> <#m_-4300588763121386083_m_2342288305175885681_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
>>
>> --
>> Resources:
>> - http://web2py.com
>> - http://web2py.com/book (Documentation)
>> - http://github.com/web2py/web2py (Source code)
>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>> ---
>> You received this message because you are subscribed to the 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/CAK8tz30J5HwWqY8au9YzxTNd%3Dz9E3N%3D1xkdiM9ei1-XBDRsMJQ%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/CA%2Bs%2BuJtKHC4smZzfA0u0mMdq95Xvw48sWD60%2BfYwpY03MzdyDw%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/CAK8tz30iUe%2BksX_Ov3oHcwVQ8RYrqfew3KctHtNehvCWTYi0LA%40mail.gmail.com.