[web2py] Re: Plain Text and HTML Email with auth.messages.verify_email

2015-06-20 Thread Falko Delarue
how did you do it? could you please explain ┐(・。・┐) ♪

On Saturday, September 15, 2012 at 1:17:50 AM UTC+2, c h wrote:
>
> for what it's worth i have re-implemented some of the auth functions that 
> send mail so that i can send both plain text and HTML emails (i don't read 
> email in HTML so i still like plain text versions).  i'm not sure how many 
> people are left who are like meif there are enough it would be great to 
> be able to specify to auth the plain text and the HTML versions for all 
> emails - perhaps even pass in path to views (which is what i do in my 
> extensions).
>
> cfh
>
> On Friday, September 14, 2012 2:25:04 PM UTC-7, Massimo Di Pierro wrote:
>>
>> If the email text looks like '' it should be send as 
>> html.
>>
>> On Friday, 14 September 2012 12:12:21 UTC-5, Mark Li wrote:
>>>
>>> Is it possible to send both Plain Text and HTML Emails with 
>>> auth.messages.verify_email? From the book, it seems 
>>> auth.messages.verify_email only accepts a single string.
>>>
>>>
>>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are 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] Guess what server is powering Silk Road Reloaded (a anonymous online drug market) on i2p

2015-01-16 Thread Falko Delarue
If you have no clue what I'm talking about
http://motherboard.vice.com/read/silk-road-reloaded-i2p

... well you guessed right

I don't know if this is good or bad, just thought is was curious.

Something for the powered by page @massimo? hehe ...

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are 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] how to: tumblr login for web2py

2015-01-05 Thread Falko Delarue
Thanks, I added it!

On Sunday, January 4, 2015 11:44:19 PM UTC+1, Michele Comitini wrote:
>
> Very nice! just one detail to make it easier for the ones that do not have 
> apt-get...
>
> sudo apt-get install python-oauth2
>
> can be replaced with:
>
> pip install --user python-oauth2
>
> making it portable to any environment where web2py works
>
> 2015-01-03 13:44 GMT+01:00 Falko Delarue  >:
>
>> This is how you login to your web2py app with Tubmblr 
>>
>> Register a Tubmblr app (you will of course need a Tubmblr account)
>>
>> https://www.tumblr.com/oauth/register
>>
>> and configure later at 
>>
>> https://www.tumblr.com/settings/apps
>>
>> get the consumer key and secret
>>
>> install the oauth2 lib (instructions only for ubuntu)
>>
>> sudo apt-get install python-oauth2
>>
>> download the pytumblr lib from (Download ZIP in right menu)
>>
>> https://github.com/tumblr/pytumblr
>>
>> extract only the pytumblr folder to yourapp/modules
>>
>> edit yourapp/modules/pytumblr/__init__.py and add dot "." in front of the 
>> helpers and request import like this
>>
>> from .helpers import validate_params, validate_blogname
>> from .request import TumblrRequest
>>
>> add the following code to your db.py 
>>
>> consumer_key = 'XXX'
>> consumer_secret = 'XX'
>>
>> request_token_url = 'http://www.tumblr.com/oauth/request_token'
>> authorize_url = 'http://www.tumblr.com/oauth/authorize'
>> access_token_url = 'http://www.tumblr.com/oauth/access_token'
>>
>> from gluon.contrib.login_methods.oauth10a_account import OAuthAccount
>> import pytumblr
>>
>> class TumblrOAuth(OAuthAccount):
>> """OAuth for Tumblr"""
>> def get_user(self):
>> if not self.accessToken():
>> return None
>>
>> client = pytumblr.TumblrRestClient(
>> consumer_key,
>> consumer_secret,
>> self.accessToken().key,
>> self.accessToken().secret,
>> )
>>
>> info = client.info()
>> if info and ('user' in info):
>> return dict(
>> first_name=info['user']['name'],
>> registration_id='tumblr:%s' % info['user']['name'],
>> )
>>
>> auth.settings.login_form = TumblrOAuth(globals(), consumer_key, 
>> consumer_secret, authorize_url, request_token_url, access_token_url)
>>
>> Replace the consumer key and secret with yours! Tumblr does not provide 
>> first or last name or an id thats why only the crude info in the return. I 
>> do not really need to create proper users so this is enough for me, you can 
>> improve on that. Also this approach will let you log in only with Tumblr, 
>> you will have to figure our the rest, this is only a basic tutorial.
>>
>> Did I miss anything? Did you like that? Write a comment!
>>
>>  -- 
>> Resources:
>> - http://web2py.com
>> - http://web2py.com/book (Documentation)
>> - http://github.com/web2py/web2py (Source code)
>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>> --- 
>> You received this message because you are 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.


[web2py] how to: tumblr login for web2py

2015-01-03 Thread Falko Delarue
This is how you login to your web2py app with Tubmblr 

Register a Tubmblr app (you will of course need a Tubmblr account)

https://www.tumblr.com/oauth/register

and configure later at 

https://www.tumblr.com/settings/apps

get the consumer key and secret

install the oauth2 lib (instructions only for ubuntu)

sudo apt-get install python-oauth2

download the pytumblr lib from (Download ZIP in right menu)

https://github.com/tumblr/pytumblr

extract only the pytumblr folder to yourapp/modules

edit yourapp/modules/pytumblr/__init__.py and add dot "." in front of the 
helpers and request import like this

from .helpers import validate_params, validate_blogname
from .request import TumblrRequest

add the following code to your db.py 

consumer_key = 'XXX'
consumer_secret = 'XX'

request_token_url = 'http://www.tumblr.com/oauth/request_token'
authorize_url = 'http://www.tumblr.com/oauth/authorize'
access_token_url = 'http://www.tumblr.com/oauth/access_token'

from gluon.contrib.login_methods.oauth10a_account import OAuthAccount
import pytumblr

class TumblrOAuth(OAuthAccount):
"""OAuth for Tumblr"""
def get_user(self):
if not self.accessToken():
return None

client = pytumblr.TumblrRestClient(
consumer_key,
consumer_secret,
self.accessToken().key,
self.accessToken().secret,
)

info = client.info()
if info and ('user' in info):
return dict(
first_name=info['user']['name'],
registration_id='tumblr:%s' % info['user']['name'],
)

auth.settings.login_form = TumblrOAuth(globals(), consumer_key, 
consumer_secret, authorize_url, request_token_url, access_token_url)

Replace the consumer key and secret with yours! Tumblr does not provide 
first or last name or an id thats why only the crude info in the return. I 
do not really need to create proper users so this is enough for me, you can 
improve on that. Also this approach will let you log in only with Tumblr, 
you will have to figure our the rest, this is only a basic tutorial.

Did I miss anything? Did you like that? Write a comment!

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are 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: no basic auth via wget because current.request.env.http_authorization is none

2014-11-06 Thread Falko Delarue
wget --user he...@gmail.com --password test1234 -q -O- 
http://test.com/testing/pages/list_pages


On Tuesday, November 4, 2014 9:57:20 AM UTC+1, Niphlod wrote:
>
> how do you call wget ?
>
> On Monday, November 3, 2014 11:51:34 PM UTC+1, Falko Delarue wrote:
>>
>> wget and the browser http://email:p...@mysite.com
>>
>> On Monday, November 3, 2014 4:24:15 PM UTC+1, Niphlod wrote:
>>>
>>> how are you trying to access the function (wget, curl, some cmdline 
>>> script, etc etc etc) ?
>>>
>>> On Monday, November 3, 2014 2:34:51 PM UTC+1, Falko Delarue wrote:
>>>>
>>>> I tried to access web2py via basic auth as described in 
>>>> http://web2py.com/books/default/chapter/29/09/access-control#Access-Control-and-Basic-Authentication
>>>> since it did not work i tried to track the error down and put some 
>>>> debug print in gluon/tools.py  Auth basic()
>>>>
>>>> I can see that the basic function is called but 
>>>> current.request.env.http_authorization is none
>>>>
>>>> I cannot find anything that has to do with authorization in either 
>>>> current.request.env or current.request
>>>>
>>>> It seems like the auth header is removed somehow, I tried wget and 
>>>> browser URL login string.
>>>>
>>>> My setup is 
>>>>
>>>> 2.9.11-stable+timestamp.2014.09.15.23.35.11
>>>> (Running on Rocket 1.2.6, Python 2.7.8)
>>>> on Ubuntu 14.10 
>>>> with wget and chrome Version 38.0.2125.111 (64-bit)
>>>>
>>>> can somebody help me?
>>>>
>>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are 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: no basic auth via wget because current.request.env.http_authorization is none

2014-11-03 Thread Falko Delarue
wget and the browser http://email:p...@mysite.com

On Monday, November 3, 2014 4:24:15 PM UTC+1, Niphlod wrote:
>
> how are you trying to access the function (wget, curl, some cmdline 
> script, etc etc etc) ?
>
> On Monday, November 3, 2014 2:34:51 PM UTC+1, Falko Delarue wrote:
>>
>> I tried to access web2py via basic auth as described in 
>> http://web2py.com/books/default/chapter/29/09/access-control#Access-Control-and-Basic-Authentication
>> since it did not work i tried to track the error down and put some debug 
>> print in gluon/tools.py  Auth basic()
>>
>> I can see that the basic function is called but 
>> current.request.env.http_authorization is none
>>
>> I cannot find anything that has to do with authorization in either 
>> current.request.env or current.request
>>
>> It seems like the auth header is removed somehow, I tried wget and 
>> browser URL login string.
>>
>> My setup is 
>>
>> 2.9.11-stable+timestamp.2014.09.15.23.35.11
>> (Running on Rocket 1.2.6, Python 2.7.8)
>> on Ubuntu 14.10 
>> with wget and chrome Version 38.0.2125.111 (64-bit)
>>
>> can somebody help me?
>>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are 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] no basic auth via wget because current.request.env.http_authorization is none

2014-11-03 Thread Falko Delarue
I tried to access web2py via basic auth as described in 
http://web2py.com/books/default/chapter/29/09/access-control#Access-Control-and-Basic-Authentication
since it did not work i tried to track the error down and put some debug 
print in gluon/tools.py  Auth basic()

I can see that the basic function is called but 
current.request.env.http_authorization is none

I cannot find anything that has to do with authorization in either 
current.request.env or current.request

It seems like the auth header is removed somehow, I tried wget and browser 
URL login string.

My setup is 

2.9.11-stable+timestamp.2014.09.15.23.35.11
(Running on Rocket 1.2.6, Python 2.7.8)
on Ubuntu 14.10 
with wget and chrome Version 38.0.2125.111 (64-bit)

can somebody help me?

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are 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: RESTful PATCH request not working

2014-08-13 Thread Falko Delarue
Ok just I tried this
@request.restful()
def page():  
def PATCH(*args, **vars):
if args[0]:
print 'PATCH args: ', args

But I still get a 400 "Bad Request" error (it does not say 400 "invalid 
arguments") that why I think it does not even come to this point.
Also request.args() should work since I can use 
def PUT(*args, **vars):
if request.args(0):
print request.args(0)
without a problem.

The real problem must be that rest_action or some function much earlier 
(maybe even in the underlying werbserver) does not accept PATCH requests


On Tuesday, August 12, 2014 7:18:14 PM UTC+2, Leonel Câmara wrote:
>
> request is available but the restful wrapper cleans request.args and calls 
> the function with them as args, you should not use request.args because 
> request.args have stuff that isn't exactly an argument, namely the method 
> 'PATCH' which is what would be in request.args(0).
>
>
> > As you may have read I am getting a 400 error not a 500, that means 
> there is no error stack trace. 
>
> That's not exactly true, the thing is, you want the rest API to inform the 
> caller if it's calling it wrong, and that's what web2py thinks it's 
> happening.
>
> Rest actions are run this way:
>
> try:
> return rest_action(*_self.args, **getattr(_self, 
> 'vars', {}))
> except TypeError, e:
> exc_type, exc_value, exc_traceback = sys.exc_info()
> if len(traceback.extract_tb(exc_traceback)) == 1:
> raise HTTP(400, "invalid arguments")
>
> There you can see where the HTTP 400 comes from.  
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are 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: RESTful PATCH request not working

2014-08-12 Thread Falko Delarue


On Tuesday, August 12, 2014 6:10:28 PM UTC+2, Leonel Câmara wrote:
>
> The problem is probably that in your PATCH function you're accessing 
> request.args(0) when you should be using args[0].
>
What? this cannot be right, the request.args(0) is a standard function 
globally available for a long time, it's web2py standard. Also, where would 
the args list come from?


> For further help you need to examine the error message you're getting as 
> calling your PATCH is raising TypeError exceptions which usually means 
> something isn't getting the correct arguments.
>
As you may have read I am getting a 400 error not a 500, that means there 
is no error stack trace. 

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are 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] RESTful PATCH request not working

2014-08-12 Thread Falko Delarue
The backbone.js framwork defines the following request type map 
http://backbonejs.org/docs/backbone.html#section-153
// Map from CRUD to HTTP for our default `Backbone.sync` implementation.
  var methodMap = {
'create': 'POST',
'update': 'PUT',
'patch':  'PATCH',
'delete': 'DELETE',
'read':   'GET'
  };

but when I implement controllers/object.py
@request.restful()
def object():
def GET(*args, **vars):
from gluon.serializers import json

def PATCH(*args, **vars):
'''
PATCH
update only a few properties of one object
'''
if request.args(0):
old_record = table[getAccess(True)]


the PATCH method is not working (chrome dev tools output)


   1. PATCH http://localhost:8000/icvs/object/object/11 400 (Bad Request) 
   jquery-2.1.1.min.js:4


So far I could not find the code in gluon that defines the allowed request 
methods. I would appreciate some help.

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are 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.