[web2py] Support for python sentry server

2015-09-24 Thread Stefan van den Eertwegh
Hi all,

I have a sentry server running for my logs and bugs from my Django projects 
which are running.
But i have also a couple web2py projects running.

Is it possible to send the traceback from web2py too a sentry server?

I believe there is still no support for python web2py from sentry's side.

Thanks!

PS: i can always custom build a send to sentry plugin for web2py but it 
would be awesome if this could be build in into web2py core itself!

-- 
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 in Parameter-based system set favicon URL

2015-09-24 Thread Dmitri Ermolaev
If I use Parameter-based system

http://web2py.com/books/default/chapter/29/04/the-core?search=favicon

how make route for http:/my_site.com/favicon.ico  ???

that nnot worked

routes_in = (
  ('/favicon.ico', '/examples/static/favicon.ico'),
  ('/robots.txt', '/examples/static/robots.txt'),
)
routes_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.


[web2py] Re: how in Parameter-based system set favicon URL

2015-09-24 Thread Niphlod
see root_static.

BTW: 
the 
https://github.com/web2py/web2py/blob/master/examples/routes.parametric.example.py
 
is quite full of useful comments.

On Thursday, September 24, 2015 at 9:52:15 AM UTC+2, Dmitri Ermolaev wrote:
>
> If I use Parameter-based system
>
> http://web2py.com/books/default/chapter/29/04/the-core?search=favicon
>
> how make route for http:/my_site.com/favicon.ico  ???
>
> that nnot worked
>
> routes_in = (
>   ('/favicon.ico', '/examples/static/favicon.ico'),
>   ('/robots.txt', '/examples/static/robots.txt'),
> )
> routes_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.


[web2py] auth.wiki markmin extra not working?

2015-09-24 Thread A3
I tried to extend the auth.wiki using the extra option but I cannot get it 
to work. 
I set  auth.wiki(resolve=False) in the models
and used the following controller:

def index():
checked = lambda text: '%s' % text + ' '
return auth.wiki(render='markmin',extra=dict(checked=checked))

in a new wiki page:
``this is OK``:checked

expect to see:  
this is OK ✓
I get: 
this is OK


I did a small test to check the function: 
by adding these line to the controller index:
z = MARKMIN("``this is OK``:checked",
extra=dict(checked=checked))
response.flash = z

this shows in the response flash:  this is OK ✓

Do I have set any other options or is it a bug.

-- 
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: auth.wiki markmin extra not working?

2015-09-24 Thread Leonel Câmara
Do you have any call to auth.wiki before this one? Say in the models?

-- 
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] time zone in web2py revisited

2015-09-24 Thread icodk
I have the following 2.5 issues with  user time zone
1. I installed the timezone plugin and followed the instructions up to that 
line: 
As soon as you call this page, session.plugin_timezone_tz is filled 
automatically with the detected timezone

which comes just after the: 

from plugin_timezone import fast_tz_detector
def detect_timezone():
tz = fast_tz_detector()
return dict(tz=tz)

The problem is that I do not call this page. I don't even know which page 
is talking about.
My application is a simple table shown in an SQLFORM.smartgrid() that 
invoked from a controller function like this(simplified): 

def show_list():
grid=SQLFORM.smartgrid(db.visit_list)
return locals()

Needless to say that the user_timezone is set to UTC and this bring me to 
the next issue:

2. If I manually set the  user_timezone='Europe/Berlin' then I do get the 
right time zone in an Edit/new forms that are started from the grid
clicking on the visit_list link or Add new line button. but a datetime 
field still shows UTC datetime in the grid itself, probably due to the 
following line:

db.visit_list.started.represent=lambda t,r: t.strftime("%m-%d %H:%M") if t 
else ''

   2.1 as a sub issue this represent line only works in the grid. In the 
Edit/new forms the datetime widget takes over and add a full datetime 
format.Could this be 
 controlled? Fx. I would like to show only "%m-%d %H:%M"

Thanks for 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.


[web2py] Re: time zone in web2py revisited

2015-09-24 Thread Niphlod
first time I hear someone having 2.5 issues, nice!

let's see if we can clear them up

1.
The plugin basically works invoking a nice js library that does its best to 
determine client-side what timezone the user is in.
This info is POSTed to web2py, and stored in the user session.
Since the "auto-determination" can only be done on client-side, you NEED to 
use that piece of code  (fast_tz_detector) in AT LEAST one page. If you 
don't know where the user lands initially, well, it's an architectural 
problem of the app. call it with ajax in every page, redirect the user 
there and then on the home page if session.plugin_timezone_tz is not there 
already, you name it.
The important bit to grasp is that if you don't use fast_tz_detector, you 
don't have the session.plugin_timezone_tz filled. 
fast_tz_detector just appends the javascript needed plus a snippet that 
fills the session value.
Without it, you NEED to guess yourself or make the user choose its 
preferred timezone explicitely (using, e.g., tz_nice_detector_widget).

2.
it's definitely dependant on your custom represent. It's the IS_DATE(TIME) 
validator that, set up with the timezone info, does "the math" and when 
called for representation, displays the right value. If you want to make 
your own representation, you need to do the 
same math. 
"The math" is pretty straightforward, given that "d" is the utc datetime 
value, is 
"d.replace(tzinfo=pytz.UTC).astimezone(pytz.timezone(user_timezone))"

2.1
web2py has a pretty extensive internationalization support, and it includes 
date formatting. IS_DATETIME and IS_DATE both take a "format" parameter 
that correctly represents the date as specified in the format. the default 
value for IS_DATETIME is "T('%Y-%m-%d %H:%M:%S')" . the T is the 
internationalization support, so if you set in the relevant language file 
to be %m-%d %H:%M, it'll be shown throughout all the app. If you don't want 
to leverage internationalization and just set a fixed representation, use 
format='%m-%d %H:%M', without any T involved . 

BTW: Fixing 2.1 will effectively eliminate the 2. issue: you won't need any 
custom represent.

-- 
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: time zone in web2py revisited

2015-09-24 Thread Itamar Cohen
Thank you Niphold
Thanks for the explanation: My specific individual problem was that it took
me a while to find out where to inject the tz script that I generate (in my
case in the  index() function). Since the index function is  the first page
in my  application I just had to add {{=tz}} in the header of the
index.html. Hopefully this will help others for faster understanding.
Thanks also for the  solution for the last  1.5 :-)

Best Regards
Itamar Cohen
Picatek
Ahornvej 27
DK-7700 Thisted
Denmark
www.picatek.dk
i...@picatek.dk
T: +45 97 91 07 82
M:+45 29 89 07 82

On 24 September 2015 at 20:56, Niphlod  wrote:

> first time I hear someone having 2.5 issues, nice!
>
> let's see if we can clear them up
>
> 1.
> The plugin basically works invoking a nice js library that does its best
> to determine client-side what timezone the user is in.
> This info is POSTed to web2py, and stored in the user session.
> Since the "auto-determination" can only be done on client-side, you NEED
> to use that piece of code  (fast_tz_detector) in AT LEAST one page. If you
> don't know where the user lands initially, well, it's an architectural
> problem of the app. call it with ajax in every page, redirect the user
> there and then on the home page if session.plugin_timezone_tz is not there
> already, you name it.
> The important bit to grasp is that if you don't use fast_tz_detector, you
> don't have the session.plugin_timezone_tz filled.
> fast_tz_detector just appends the javascript needed plus a snippet that
> fills the session value.
> Without it, you NEED to guess yourself or make the user choose its
> preferred timezone explicitely (using, e.g., tz_nice_detector_widget).
>
> 2.
> it's definitely dependant on your custom represent. It's the IS_DATE(TIME)
> validator that, set up with the timezone info, does "the math" and when
> called for representation, displays the right value. If you want to make
> your own representation, you need to do the
> same math.
> "The math" is pretty straightforward, given that "d" is the utc datetime
> value, is
> "d.replace(tzinfo=pytz.UTC).astimezone(pytz.timezone(user_timezone))"
>
> 2.1
> web2py has a pretty extensive internationalization support, and it
> includes date formatting. IS_DATETIME and IS_DATE both take a "format"
> parameter that correctly represents the date as specified in the format.
> the default value for IS_DATETIME is "T('%Y-%m-%d %H:%M:%S')" . the T is
> the internationalization support, so if you set in the relevant language
> file to be %m-%d %H:%M, it'll be shown throughout all the app. If you don't
> want to leverage internationalization and just set a fixed representation,
> use format='%m-%d %H:%M', without any T involved .
>
> BTW: Fixing 2.1 will effectively eliminate the 2. issue: you won't need
> any custom represent.
>
> --
> 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/jIEUIb8wxtg/unsubscribe.
> To unsubscribe from this group and all its topics, 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: no password asked when accessing appadmin directly [was:] recommented way to secure appadmin

2015-09-24 Thread Anthony
What happens when it gets to this part of the code in 
/controllers/appadmin.py: 
https://github.com/web2py/web2py/blob/R-2.12.3/applications/welcome/controllers/appadmin.py#L55

Does it call gluon.fileutils.check_credentials(request)? What is in the 
admin session at that time? Can you access the admin app at this point, or 
only the appadmin controller?

Anthony

On Thursday, September 24, 2015 at 4:26:15 PM UTC-4, Karl-Thomas Schmidt 
wrote:
>
> I confirm, i can access appadmin, if i enter 
> https://my.domain.somewhere/myapp/appadmin without beeing asked for admin 
> password. This happens with all cookies deleted and explictly logout of 
> former 
> sessions too. 
>
> Can someone confirm this? 
>
> 2.12.3-stable+timestamp.2015.08.19.00.18.03 
> (Running on nginx/1.6.2, Python 2.7.9) 
>
>
> Am Dienstag, 15. September 2015, 09:41:15 schrieb Leonel Câmara: 
> > Errr appadmin by default asks for the admin interface password. Are you 
> > sure you haven't already entered 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.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: auth.wiki markmin extra not working?

2015-09-24 Thread A3
I made a new application and only added the code to the index: and now it 
works.
Then I tried to do the same in my earlier application. 
Replaced index: 
Replaced view/index
Replaced model/db
This had no effect. 

Op donderdag 24 september 2015 16:18:22 UTC+2 schreef Leonel Câmara:
>
> Do you have any call to auth.wiki before this one? Say in the models?
>

-- 
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 password asked when accessing appadmin directly [was:] recommented way to secure appadmin

2015-09-24 Thread 'Karl Thomas Schmidt' via web2py-users
I confirm, i can access appadmin, if i enter 
https://my.domain.somewhere/myapp/appadmin without beeing asked for admin 
password. This happens with all cookies deleted and explictly logout of former 
sessions too.

Can someone confirm this?

2.12.3-stable+timestamp.2015.08.19.00.18.03
(Running on nginx/1.6.2, Python 2.7.9) 


Am Dienstag, 15. September 2015, 09:41:15 schrieb Leonel Câmara:
> Errr appadmin by default asks for the admin interface password. Are you
> sure you haven't already entered 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.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: auth.wiki markmin extra not working?

2015-09-24 Thread Leonel Câmara
I think this is a quite subtle bug. It's caused because auth only 
instantiates Wiki on the first call to auth.wiki. Later when you make a 
second call with extra set it doesn't do anything. To fix it open 
gluon/tools.py in your web2py installation and then where it says:


else:
self._wiki.env.update(env or {})

Change to:

else:
self._wiki.settings.extra = extra
self._wiki.env.update(env or {})

I'll make a pull request to fix it soon.

-- 
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] Nginx / Web2py modules dont reload

2015-09-24 Thread Mark Billion
Running w2p on nginx/ubuntu 14.04.  When I change a module's code, the 
changes dont show up when I load the app again (ie a class that returned 2 
but now returns 1 still returns 2).  Ive turned sendfile off in Nginx and 
have reloaded the thing over and over.  Sometimes it works and sometimes I 
get the same (wrong) result. Any thoughts?  

-- 
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] images in {{for index,image in enumerate(images):}} of my tiny website app.

2015-09-24 Thread Aydin S
I am trying to learn from "my tiny website" app and use the slide show that 
it is used there in the "images/images.html" view.
I created a new view like default/mynewpage.html and copied 
"images/images.html" view into it; when I ran it there was an error " 
"images" is not defined. 
I did some debugging, I found out it is about line 10 in the 
"images/images.html" view that causes this error:
{{for index,image in enumerate(images):}}

the whole view is like this:
{{extend 'layout.html'}}
{{for page in pages:}}







{{for index,image in enumerate([i for i in images 
if i.page==page]):}}
{{if index==0:}}

{{else:}}

{{pass}}
{{if auth.has_membership('manager'):}}
{{=manager_toolbar(image.id)}}
{{pass}}


{{pass}}









{{pass}}


what's happening here is that it looks like the "image" table that has 
"images" field in it is not accessible by my new page; any help or 
suggestion to debug this? 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.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: images in {{for index,image in enumerate(images):}} of my tiny website app.

2015-09-24 Thread Anthony
You have to define the "images" object somewhere (presumably it is a Rows 
object, which is the result of querying the database). Typically it would 
be defined in the controller action and returned in the action's dictionary 
(though it could also be defined in a model file if it is needed by 
multiple controllers).

Anthony

On Thursday, September 24, 2015 at 9:02:34 PM UTC-4, Aydin S wrote:
>
> I am trying to learn from "my tiny website" app and use the slide show 
> that it is used there in the "images/images.html" view.
> I created a new view like default/mynewpage.html and copied 
> "images/images.html" view into it; when I ran it there was an error " 
> "images" is not defined. 
> I did some debugging, I found out it is about line 10 in the 
> "images/images.html" view that causes this error:
> {{for index,image in enumerate(images):}}
>
> the whole view is like this:
> {{extend 'layout.html'}}
> {{for page in pages:}}
> 
> 
> 
>  class="carousel slide">
> 
> 
> 
> {{for index,image in enumerate([i for i in images 
> if i.page==page]):}}
> {{if index==0:}}
> 
> {{else:}}
> 
> {{pass}}
> {{if auth.has_membership('manager'):}}
> {{=manager_toolbar(image.id)}}
> {{pass}}
>  src="{{=URL('static','images/photo_gallery/%s' %(image.file))}}">
> 
> {{pass}}
> 
> 
> 
> 
> 
> 
> 
> 
> 
> {{pass}}
>
>
> what's happening here is that it looks like the "image" table that has 
> "images" field in it is not accessible by my new page; any help or 
> suggestion to debug this? 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.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Simple Wiki Markmin Google docs viewer needs HTTPS

2015-09-24 Thread Massimo Di Pierro
Is there any @auth.require* protection for the url that serves the xls 
document? The viewer is a google app and it does not share your 
credentials. It wants the doc to be public.

On Wednesday, 23 September 2015 08:50:35 UTC-5, A3 wrote:
>
> Hi Massimo: 
> I tried it: browser is no longer complaining about mixed content but ..
> the viewer is not showing anything.
> I tried to open the document in the viewer using the rendered link:
>
> https://docs.google.com/viewer?url=https://www.myserver.com/application/default/index/3/testexcel.xls=true
> This shows a document with the HTML login page?  
> It seems web2py doesn't want to pass the excel document to the viewer?
>
>
>  
>
> Op donderdag 20 augustus 2015 21:00:58 UTC+2 schreef Massimo Di Pierro:
>>
>> Made a change in master branch that uses https instead of http for this. 
>> Please try it.
>>
>> On Wednesday, 19 August 2015 16:39:14 UTC-5, A3 wrote:
>>>
>>> Hi, I tried to use the Simple Wiki and found the following problem:
>>> I uploaded an excel file in page media.
>>> On the wiki page I used the link to the uploaded file: 
>>> @3/testexcel.xls
>>> When i look at the page i get an empty square.   
>>> I am using Chrome: when I inspect the element, is shows:  
>>> Mixed Content: The page at 'https://_.
>>> pythonanywhere.com/controller/default/index/page#' was loaded over 
>>> HTTPS, but requested an insecure resource '
>>> http://docs.google.com/viewer?url=https%3A//f.pythonanywhere.com/controller/default/index/3/testexcel.xls=true'.
>>>  
>>> This request has been blocked; the content must be served over HTTPS.  
>>>
>>> hope anybody can help.
>>> regards Adri
>>>
>>

-- 
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: Nginx / Web2py modules dont reload

2015-09-24 Thread Mark Billion
Sadly I've tried that too

-- 
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: Nginx / Web2py modules dont reload

2015-09-24 Thread Leonel Câmara
Yeah I pretty much just restart uwsgi-emperor or touch the affected 
application config file in /etc/uwsgi/vassals

-- 
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: Nginx / Web2py modules dont reload

2015-09-24 Thread Massimo Di Pierro
Track changes is really meant for testing and not for production and I 
cannot exclude something strange can happen in a highly concurrent 
environment. If the module is in the app modules/ folder, all workers 
should update it but something else may be going on. As Leonel says 
restarting uwsgi-emperor is the safest thing. 

On Thursday, 24 September 2015 18:38:32 UTC-5, Mark Billion wrote:
>
> Running w2p on nginx/ubuntu 14.04.  When I change a module's code, the 
> changes dont show up when I load the app again (ie a class that returned 2 
> but now returns 1 still returns 2).  Ive turned sendfile off in Nginx and 
> have reloaded the thing over and over.  Sometimes it works and sometimes I 
> get the same (wrong) result. Any thoughts?  
>

-- 
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] Installing app on Pythonanywhere

2015-09-24 Thread Joe
When I install the packaged app using the admin interface on Pythonanywhere 
I have to name the app init otherwise I am not allowed to install the app.

I wonder why this is happening. Is there any way to avoid this? I end up 
with a URL like this:http://www.mydomain.com/init/default/index
Actually, I would prefer to have a URL like 
this:http://www.mydomain.com/index
I would appreciate some advise.
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.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Nginx / Web2py modules dont reload

2015-09-24 Thread 黄祥
perhaps it about web2py custom import
e.g.
models/db.py
## uncomment when running on development
from gluon.custom_import import track_changes; track_changes(True)

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.


[web2py] Re: Questions about authentication and authorization

2015-09-24 Thread Massimo Di Pierro
each app (provider and consumer) has its own session cookies. An 
authentication gets passed between the two at login, similarly to oauth.

On Sunday, 20 September 2015 18:54:44 UTC-5, Luis Valladares wrote:
>
> After some discussion with my team we come with this architecture:
>
> We will have a service to manage authentication and authorization, all our 
> services will query him in order to get permission and credential, for 
> authentication we will use CAS and for authorization RBAC over sended over 
> JSON.
>
> I've another question, exactly how CAS works? i mean, i know the theory 
> that you log in the CAS provider and you will be logged in the CAS 
> consumer, but how this works? with session cookies and a token? or how CAS 
> communicate with the consumers
>
> El lunes, 14 de septiembre de 2015, 21:54:30 (UTC-4:30), Luis Valladares 
> escribió:
>>
>> Thanks for your answer!
>>
>> I've been reading about JWT too, and i consider it for application 
>> authorization, the thing is i dont feel comfortable sending the parameters 
>> through JSON, i prefer to send it via POST parameters and so, but after 
>> reading the link you posted sounds like a good solution for app 
>> authentication, and i will consider this along with Amazon approach and 
>> OAuth2. The thing that is really bottering me is the authorization of 
>> users. Any sugestion on this field?
>>
>> Thank you very much!
>>
>> El lunes, 14 de septiembre de 2015, 18:19:12 (UTC-4:30), Dave S escribió:
>>>
>>>
>>>
>>> On Monday, September 14, 2015 at 3:35:20 PM UTC-7, Luis Valladares wrote:

 Since i do the post i found some interesting articles, and now i have a 
 better implementation idea, but i'm still looking for the solution on a 
 subject. Here is what i have now:

 I will handle the authentication of my applications using the amazon 
 approach (
 http://www.thebuzzmedia.com/designing-a-secure-rest-api-without-oauth-authentication/)
  
 and the user authentication using CAS in order to centralize al the 
 services auth providers, but i'm still searching for a way to handle the 
 authorization for user, i read about Spring security but i didnt see any 
 implementation in python or web2py

 Again, thanks for any help!

>>>
>>> Perhaps Niphlod's JWT implementation would work for you, too.
>>>
>>> Quoting his example again:
>>>
>>>
 As per "original" demand of covering one-time-issued tokens, the "jti" 
 claim is the standard, and can be easily implemented, imagining to store 
 valid tokens in a database table:

 db.define_table('jwt_tokens', Field('token'), Field('user_id'), Field(
 'inserted_on', 'datetime', default=request.now))

 def myadditional_payload(payload):
  res = db(db.jwt_tokens.user_id == payload['user']['id']).select(
 orderby=~db.jwt_tokens.inserted_on).first()
  payload['jti'] = res.token
  return payload

 def mybefore_authorization(tokend):
  res = db(
 (db.jwt_tokens.user_id == tokend['user']['id']) & 
 (db.jwt_tokens.token == tokend['jti'])
  ).select().first()
  if not res:
  raise HTTP(400, u'Invalid JWT jti claim')

 myjwt = Web2pyJwt('secret', auth, 
   additional_payload=additional_payload, 
   before_authorization=mybefore_authorization)
  
>>>
>>>
>>> The list of features is in his post in the developer's forum.
>>> >> https://groups.google.com/d/msg/web2py-developers/dXfUrHNI5Sg/gqNa3kXsCQAJ
>>> >
>>>
>>> If you need some background on JWT, my reading list recently included
>>> 
>>> (that's the standard as of May; it's actually readable by users of 
>>> standards as well the writers, I think)
>>>
>>> /dps
>>>
>>>  
>>>
>>

-- 
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: Grails for web2py - anyone interested ?

2015-09-24 Thread Massimo Di Pierro
I agree with Joe. Now we are all curious.


On Wednesday, 23 September 2015 18:55:18 UTC-5, Joe Barnhart wrote:
>
> Not to worry Grahme -- I find most web2py'ers are an adventurous lot. 
>  Massimo (our BDFL) is probably more adventurous than anyone!  You won't 
> get in trouble for "impure thinking" around here...  Heck, we get 
> criticized a lot for not being "pythonic enough" ourselves.
>
> Look forward to seeing your version of web2grails!  (Grails is, of course 
> "groovy on rails" which borrows from Rails, which web2py ALSO borrows from. 
>  So.  The parentage is getting pretty mixed!)
>
> -- Joe
>
>
> On Monday, September 21, 2015 at 12:20:11 PM UTC-7, Graham Ranson wrote:
>>
>>
>> And I do understand that this whole approach may be seen as not in the 
>> spirit of web2py so I'll apologise in advance if I am causing any 
>> distress. 
>>
>>

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