Re: [web2py] Re: Push Notifications

2020-11-19 Thread mostwanted
Hey Ramos, I was able to successfully register the app on pusher.com. 
towards step 4 its says i should copy this code:
*CODE:*
curl -H "Content-Type: application/json" \
 -H "Authorization: Bearer 
9C9232906DFC6C8F8115926CC30D637945EB75F60467DA77977C399C4235E61C" \
 -X POST 
"https://733e2240-aca0-4a12-a5a9-c3b1422b9063.pushnotifications.pusher.com/publish_api/v1/instances/733e2240-aca0-4a12-a5a9-c3b1422b9063/publishes;
 
\
 -d 
'{"interests":["hello"],"web":{"notification":{"title":"Hello","body":"Hello, 
world!"}}}'

to my console! Which console is this one? My desktop console? I'm hosted 
with pythonanywhere.com, can i use the Bash console in my dashboard?

On Tuesday, November 17, 2020 at 7:53:20 AM UTC+2 mostwanted wrote:

> Thanks alot Ramos, think this will work, very little work needs to be done 
> here, I'll try it out.
>
> On Tuesday, November 17, 2020 at 1:06:10 AM UTC+2 Ramos wrote:
>
>> Why reiventing the wheel ??? 
>> https://pusher.com/
>>
>> I use it with web2py and works like a charm
>>
>>
>> Em seg., 16 de nov. de 2020 às 08:44, mostwanted  
>> escreveu:
>>
>>> So far all I have been able achieve is asking the user for permission to 
>>> send them notifications & if they accept all that happens is that everytime 
>>> they open the app they get a greetings notification, achieving that was not 
>>> complicated because it was straight forward, I placed the code in my 
>>> main.js script & it runs everytime the service worker gets registered.
>>>
>>> *CODE:*
>>> Notification.requestPermission(result => {
>>>   if (result === 'granted') {
>>> showNotification('Welcome to My App™', 'Everything Services™')
>>>   }
>>> });
>>>
>>> function showNotification(title, message) {
>>>   if ('Notification' in window) {
>>> navigator.serviceWorker.ready.then(registration => {
>>>   registration.showNotification(title, {
>>> body: message,
>>> tag: 'my-app',
>>> icon:'/init/static/images/icon_192x192.png',
>>> badge:'/init/static/images/icon_128x128.png',
>>> vibrate: [200, 100, 200, 100, 200, 100]
>>>   });
>>> });
>>>   }
>>> }
>>>
>>>
>>> On Monday, November 16, 2020 at 10:31:10 AM UTC+2 mostwanted wrote:
>>>

 Has anyone been able to implement push notifications on their web2py 
 apps? 

 I need a working application with some examples on how to implement 
 this for one of my applications.

 I've been looking at the "web-push-book (
 https://web-push-book.gauntface.com/how-push-works/)" but I cant put 
 it together in my head.

 What I wanna achieve is relatively basic, I have an applivcation that 
 offers information on services & products sold in my area, so what I want 
 is to be able to send notifications everytime a new service or product is 
 registered.

 If anyone has any idea on how I can easily implement this please help 
 me.

 Regards;

 Mostwanted

>>> -- 
>>> Resources:
>>> - http://web2py.com
>>> - http://web2py.com/book (Documentation)
>>> - http://github.com/web2py/web2py (Source code)
>>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>>> --- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "web2py-users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to web2py+un...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/web2py/01da1065-f7d3-4394-9014-a424639bef03n%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/ca28be9e-6720-4993-9f68-1a42cf57a2c1n%40googlegroups.com.


[web2py] How to pass variables to db.executesql?

2020-11-19 Thread Alex Glaros
for example 

where mytable.id = someWeb2PyVariable

thanks,

Alex Glaros 

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the 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/fa1cf04c-a01c-40fa-8e00-20295fa46113n%40googlegroups.com.


Re: [web2py] Login via an link/URL

2020-11-19 Thread valq...@gmail.com
login_bare is a normal function, it is intended to login through ajax, but 
it cant be used in this case, since it requires raw password (not hash).
I would create a table that maps hash of url (!!! Not url itself and  not 
hash-like part of url) to user_id and then use auth.login_user as Carlos 
mentioned.

среда, 18 ноября 2020 г. в 16:19:35 UTC+3, roge...@gmail.com: 

> Thanks Carlos
>
> I couldnt find the login_user() function in the book but i did find it 
> here: 
> https://web2py.readthedocs.io/en/latest/_modules/gluon/tools.html#Auth.login_user
>  
>
> Does  login_user(self, user)  essentially bypass the normal 
> authentication process?
> And is  login_bare(self, username, password)  the normal login function?
>
> Andrew
>  
>
> ___
> *www.TenOutOfTen.org* 
> roge...@gmail.com
> (+95) 09 250018669 <+95%209%20250%20018%20669> (Myanmar)
>
>
> On Wed, 18 Nov 2020 at 21:26, Carlos Correia  
> wrote:
>
>> On 17/11/20 22: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+un...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/web2py/e8102d90-88c8-4a4c-abcb-96ba7aa54cddn%40googlegroups.com
>>  
>> 
>> .
>>
>> Hi,
>>
>> I would write the hash somewhere in the filesystem, create a controller 
>> to verify the hash, then use Auth.login_user() to authenticate the user.
>>
>> Having said that, please note that it is a (very) bad idea, since a "man 
>> in the middle" could easily intercept the mail and hack the session.
>>
>> Regards,
>>
>> Carlos Correia
>> =
>> MEMÓRIA PERSISTENTE
>> GSM:  917 157 146 (Signal, WhatsApp)
>> e-mail: ge...@memoriapersistente.pt
>> URL: http://www.memoriapersistente.pt
>> XMPP (Jabber): car...@memoriapersistente.pt
>>
>> -- 
>> Resources:
>> - http://web2py.com
>> - http://web2py.com/book (Documentation)
>> - http://github.com/web2py/web2py (Source code)
>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>> --- 
>> You received this message because you are 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/00b9aa90-1458-f9c5-ae9b-703e740341d7%40memoriapersistente.pt
>>  
>> 
>> .
>>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the 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/434776c9-cf49-4fbc-b251-1c49cd8ef32dn%40googlegroups.com.


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

2020-11-19 Thread Jon Subscripted
Thanks Alex!

El El mié, 18 nov 2020 a las 14:38, Alex Beskopilny 
escribió:

> dasjboards for web2py https://github.com/ali96343/facew2p
> dashboards  for py4web https://github.com/ali96343/facep4w
> charts Highcharts.js
> On Tuesday, November 17, 2020 at 11:47:04 AM UTC+3 Jonsubs wrote:
>
>> 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_-8178090592855306788_m_-2958339010838646051_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/b33a4e69-68f9-4607-aa3f-99f1f661fb34n%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/CAK8tz32YxX6QvYag4XkY9MS4wx-KpbtihkRZ1CF6r7dnW%2BvA3Q%40mail.gmail.com.