Re: [web2py] request.now is in local time?

2011-08-20 Thread Jonathan Lundell
On Aug 20, 2011, at 10:04 AM, nick name wrote: > On Saturday, August 20, 2011 11:19:07 AM UTC-4, Jonathan Lundell wrote: > Yeah, it probably should have been utcnow. Nothing to stop you (or web2py, > for that matter) from setting request.utcnow, though. > > Yep, I am already doi

Re: [web2py] An issue with trunk changes to password rules

2011-08-21 Thread Jonathan Lundell
On Aug 21, 2011, at 7:45 AM, apple wrote: > On trunk the password has to be over a certain length. If I try to > login to an existing application with an existing user then it says my > password is not long enough. However there is no way of changing it > without logging in! I do something like t

Re: [web2py] An issue with trunk changes to password rules

2011-08-21 Thread Jonathan Lundell
On Aug 21, 2011, at 8:33 AM, Jonathan Lundell wrote: > I do something like this. Your details might vary. > > # invoke IS_STRONG only for password creation, not password checking > if "login" not in request.args: >auth.settings.table_user.password.requires.insert(0

Re: [web2py] An issue with trunk changes to password rules

2011-08-21 Thread Jonathan Lundell
On Aug 21, 2011, at 9:27 AM, Jonathan Lundell wrote: > On Aug 21, 2011, at 8:33 AM, Jonathan Lundell wrote: > >> I do something like this. Your details might vary. >> >> # invoke IS_STRONG only for password creation, not password checking >>

Re: [web2py] An issue with trunk changes to password rules

2011-08-21 Thread Jonathan Lundell
On Aug 21, 2011, at 11:20 AM, Anthony wrote: > On Sunday, August 21, 2011 1:56:00 PM UTC-4, Jonathan Lundell wrote: > On Aug 21, 2011, at 9:27 AM, Jonathan Lundell wrote: > > On Aug 21, 2011, at 8:33 AM, Jonathan Lundell wrote: > > > >> I do something like th

Re: [web2py] Re: An issue with trunk changes to password rules

2011-08-21 Thread Jonathan Lundell
4 pm, Jonathan Lundell wrote: >> On Aug 21, 2011, at 11:20 AM, Anthony wrote: >> >> >> >> >> >> >> >> >> >>> On Sunday, August 21, 2011 1:56:00 PM UTC-4, Jonathan Lundell wrote: >>> On Aug 21, 2011, at 9:27 AM, Jona

Re: [web2py] routes.py

2011-08-25 Thread Jonathan Lundell
On Aug 25, 2011, at 4:48 PM, Kenneth Lundström wrote: > I'd like to have three types of routings: > > a) web2py.main_domain.comdefaults to init, but you can choose the > application with web2py.main_domain.com > > b) testing.main_domain.com leads to application: testing > > c) developm

Re: [web2py] routes.py

2011-08-25 Thread Jonathan Lundell
On Aug 25, 2011, at 9:28 PM, Kenneth Lundström wrote: > On 26.8.2011 5:21, Jonathan Lundell wrote: >> On Aug 25, 2011, at 4:48 PM, Kenneth Lundström wrote: >> >>> I'd like to have three types of routings: >>> >>> a) web2py.main_domain.

Re: [web2py] linux help

2011-08-26 Thread Jonathan Lundell
On Aug 26, 2011, at 9:51 AM, Sebastian E. Ovide wrote: > what about "something" like this ? > > #!/bin/bash > if test "/path/to/VERSION" -nt "/path/to/VERSION.track" > then > # touch VERSION.track > # restart apache > else > nothing > fi > > > and run it in cron once every 5 minutes or so ..

Re: [web2py] Re: GAE deployment problem

2011-08-26 Thread Jonathan Lundell
On Aug 26, 2011, at 6:32 PM, Jarrod Cugley wrote: > I'm kind of confused because I downloaded web2py on the mac and I have > a web2py.app file that has the folder 'Contents' inside it which then > has inside it: Frameworks, MacOS, Resources. > > I've been treating Resources as my top-level folder

[web2py] parametric router enhancements

2011-08-28 Thread Jonathan Lundell
(in the trunk, not the stable release, as of today) Due to popular demand, there are a couple of enhancements to the parametric ("new") router. One is the ability to specify a default function per controller. In the configuration, default_function has been (and can still be) a string, which sp

Re: [web2py] parametric router enhancements

2011-08-28 Thread Jonathan Lundell
On Aug 28, 2011, at 10:44 AM, Bruno Rocha wrote: > Lets say I have a dict of all my controlers/actions > > dict(default=['index','page'], account=['user','login','profile','logout']) > > when requests any that are in the dict should be executed, normal.. but > > if request anything that are not

Re: [web2py] Re: Useful validators IS_LETTERS, IS_DIGITS

2011-08-28 Thread Jonathan Lundell
On Aug 28, 2011, at 11:23 AM, Saurabh Sawant wrote: > They seem fine. Although, having ready to use validators would save > some time for those learning the framework. I personally expected > those validators to be already there while I was learning. Trouble is, there's an endless list of pattern

Re: [web2py] parametric router enhancements

2011-08-28 Thread Jonathan Lundell
On Aug 28, 2011, at 2:26 PM, Bruno Rocha wrote: > Proxy is a great idea, but I would like to keep the url as it is. > > I will make account the default controller, and in account I will create a > proxy to redirect to the index page if passed /index, or something like this. > It'd be nice to h

Re: [web2py] Re: parametric router enhancements

2011-08-28 Thread Jonathan Lundell
we can use them to implement a redirect(URL(), local=True) Yeah, I was thinking along those lines. Not sure if it's worth it, and it'd be easy to misuse, but a full redirect is pretty expensive (time, not cycles). > > > On Aug 28, 4:40 pm, Jonathan Lundell wrote: >> On

Re: [web2py] Re: Howto change request.uri_language through URL function?

2011-08-29 Thread Jonathan Lundell
On Aug 29, 2011, at 8:50 PM, Massimo Di Pierro wrote: > The parametric router allows: > > routers = dict( ># base router >BASE = dict( >default_application = app, >), >app = dict( >default_language = 'en', >languages = ['en', 'it', 'pt', 'pt-br'], >), >

Re: [web2py] Re: Howto change request.uri_language through URL function?

2011-08-29 Thread Jonathan Lundell
On Aug 29, 2011, at 9:26 PM, Jonathan Lundell wrote: > On Aug 29, 2011, at 8:50 PM, Massimo Di Pierro wrote: > >> The parametric router allows: >> >> routers = dict( >> # base router >> BASE = dict( >> default_application = app, >> ),

Re: [web2py] Re: Parameter-Based System routers errors

2011-08-30 Thread Jonathan Lundell
On Aug 30, 2011, at 7:47 AM, Anthony wrote: > I believe routes_onerror can be used with the parameter-based system as well > as the pattern-based system. See > http://web2py.com/book/default/chapter/04#Routes-on-Error. Right. Error handling is identical under both routers.

Re: [web2py] Re: cannot run web2py on windows 7 machine with python 2.7 installed

2011-08-30 Thread Jonathan Lundell
On Aug 30, 2011, at 8:37 AM, Alan Etkin wrote: > I am not sure, but it seems that another application is blocking the > access to port 8000. Did you check if the windows firewall is not > blocking the port?. Otherwise try specifying another port than 8000 > (higher) in the development server argum

Re: [web2py] Mapping URLS in routes.py

2011-08-31 Thread Jonathan Lundell
On Aug 31, 2011, at 12:06 PM, Andrew Evans wrote: > Hello I have the following in my routes.py file but its not mapping the > second domain to the web2py project any ideas whats up? > > routers = dict( > > # base router > BASE = dict( > default_application = 'cheer10s', >

Re: [web2py] Mapping URLS in routes.py

2011-08-31 Thread Jonathan Lundell
ain ty for the advice > > This is a great forum :-) > > On Wed, Aug 31, 2011 at 1:36 PM, Jonathan Lundell wrote: > On Aug 31, 2011, at 12:06 PM, Andrew Evans wrote: > >> Hello I have the following in my routes.py file but its not mapping the >> second domain to the web2p

Re: [web2py] Re: Bug in TR when rendering an array

2011-08-31 Thread Jonathan Lundell
On Aug 31, 2011, at 5:50 PM, Noel Villamor wrote: > > By the way, the reason why I stumbled on this is because I wanted to > add a fourth TD to my test case. > > {{=TABLE(TR(TD('first'),*[TD(x) for x in arr],TD('fourth')))}} > or more simply > {{=TABLE(TR(TD('first'),*arr,TD('fourth')))}} > > B

Re: [web2py] Priorities for web2py applications?

2011-09-01 Thread Jonathan Lundell
On Aug 31, 2011, at 4:33 AM, Henri Heinonen wrote: > Is it possible to set priorities for web2py applications? > > I am running a web2py server with some simulation applications. When I > run them, the welcome application works very sluggishly so it seems to > a visitor of my web2py server that t

Re: [web2py] Re: Big problem -- no session_id without using Auth

2011-09-01 Thread Jonathan Lundell
On Sep 1, 2011, at 11:25 AM, Joe Barnhart wrote: > Update -- > > This problem is variable. After logging into the admin session, > logging out, closing the browser, and then opening it again the > website seems to add sessions for me even as an unauthenticated user. > Even after opening up a dif

Re: [web2py] Re: Big problem -- no session_id without using Auth

2011-09-01 Thread Jonathan Lundell
The cookie name is 'session_id_%s' % appname, so you'd want that cookie from the current document. > > -- Joe B. > > On Sep 1, 11:38 am, Jonathan Lundell wrote: >> On Sep 1, 2011, at 11:25 AM, Joe Barnhart wrote: >> >>> Update -- >> >&g

Re: [web2py] More fun with session_id

2011-09-01 Thread Jonathan Lundell
On Sep 1, 2011, at 5:47 PM, Joe Barnhart wrote: > I'm having my share of session issues these days. This hour, my > problem is that the variable "response.session_id" does not seem to be > set at the point the model files are executed. > > I am storing sessions in the database (sqlite) to help w

Re: [web2py] Priorities for web2py applications?

2011-09-02 Thread Jonathan Lundell
On Sep 1, 2011, at 11:57 PM, Henri Heinonen wrote: > 2011/9/1 Jonathan Lundell > If it's convenient, you might experiment with calling time.sleep(0) fairly > frequently in your CPU-bound simulation app, perhaps in some inner loop, to > yield to other threads. > > I trie

Re: [web2py] content type of jsonrpc service reply

2011-09-02 Thread Jonathan Lundell
On Sep 2, 2011, at 1:01 PM, Stefaan Himpe wrote: > I seem to have hit an unexpected detail of the jsonrpc support in web2py: > when I post a json request to my web2py application, I get a json reply with > a content-type set to "text/html; charset=utf8" (whereas i had expected > something like

Re: [web2py] Re: content type of jsonrpc service reply

2011-09-02 Thread Jonathan Lundell
Is this coming through generic.json? On Sep 2, 2011, at 2:15 PM, Stefaan Himpe wrote: > >> There *is* a bug, but it should be generating text/x-json (and that should >> be fixed). Are you sure you're getting text/html? > > I definitely received text/html. > (web2py 1.98.2, running on rocket 1

Re: [web2py] Re: content type of jsonrpc service reply

2011-09-02 Thread Jonathan Lundell
On Sep 2, 2011, at 3:45 PM, Stefaan Himpe wrote: >> Is this coming through generic.json? > > I created a simple web application from scratch, only added this code in the > controller (I think web2py has support for both json and jsonrpc? i'm using > jsonrpc here): It looks to me as if Service.

Re: [web2py] content type of jsonrpc service reply

2011-09-03 Thread Jonathan Lundell
On Sep 2, 2011, at 2:15 PM, Stefaan Himpe wrote: >> There *is* a bug, but it should be generating text/x-json (and that should >> be fixed). Are you sure you're getting text/html? > > I definitely received text/html. > (web2py 1.98.2, running on rocket 1.2.2). This should be fixed in the trunk.

Re: [web2py] Re: testing scheduler in windows

2011-09-03 Thread Jonathan Lundell
On Sep 3, 2011, at 2:03 PM, Massimo Di Pierro wrote: > Yes and no. > > The new scheduler uses multiprocessing to make sure each task is > executed in its on process. This allows the main process to monitor > the task and eventually terminate it. It also prevents a task from > messing up the worke

Re: [web2py] Re: Bug? unicode error on LOAD w/ test case

2011-09-04 Thread Jonathan Lundell
On Sep 4, 2011, at 12:13 PM, weheh wrote: > In the previous post, looks like our google groups app lost the > improperly translated character. It should have read Espaol. The was a white question mark in a black diamond. That's what I saw. > With some further experimentation, doing something li

Re: [web2py] unicode error on LOAD w/ test case [not a web2py bug]

2011-09-04 Thread Jonathan Lundell
On Sep 4, 2011, at 3:25 PM, weheh wrote: > Grrr, grrr, and triple grr. This encoding stuff can be so > awfully painful (all the time, it seems). > > OK, Jonathan, I'm pretty sure you are right, it's an editor encoding > problem, not a web2py problem. > > I swear to you that I have vi

Re: [web2py] Re: web2py app with no CSS or javascript?

2011-09-11 Thread Jonathan Lundell
On Sep 11, 2011, at 6:48 AM, Anthony wrote: > I don't think there's any setting. You could strip them out of layout.html, > or create your own layout.html. I believe that certain aspects of the interface depend on JavaScript, like anything requiring a second button (delete?), the delete confirm

Re: [web2py] Re: Use the bundled python interpreter

2011-09-11 Thread Jonathan Lundell
On Sep 11, 2011, at 6:53 AM, Anthony wrote: > I don't know how it works on the Mac, but on Windows, you start the binary > version at the command line by entering 'web2py.exe' (can also pass command > line options). Maybe it's the same on Mac -- i.e., just enter 'web2py.app'? In OS X use the co

Re: [web2py] Re: web2py.com is down

2011-09-11 Thread Jonathan Lundell
On Sep 11, 2011, at 10:38 AM, Phyo Arkar wrote: > was it coz bossie award , too many hits flooded and downed? I'd guess that it's up to us to make use of the Bossie to drive traffic to the site. I wonder how many potential users read InfoWorld? The biggest utility of the award is that it helps

Re: [web2py] web2ruby possible?

2011-09-11 Thread Jonathan Lundell
On Sep 11, 2011, at 11:21 AM, António Ramos wrote: > hello > > why not translate web2py to ruby? > > is this a good question or what? > Go for it.

Re: [web2py] web2ruby possible?

2011-09-11 Thread Jonathan Lundell
On Sep 11, 2011, at 1:35 PM, Bruno Rocha wrote: > I am more interested in some web2go http://golang.org/ You'd have to work the compiler into the app-development cycle. But I don't think Go is sufficiently dynamic.

Re: [web2py] How to flash a message after a callback

2011-09-11 Thread Jonathan Lundell
On Sep 11, 2011, at 7:57 PM, Noel Villamor wrote: > I have a button which does the following callback: > > ajax('{{=URL('callback')}}',['btn1'],':eval');" > > Then I have the following callback function in my controller: > > def callback(): >db(db.tbl.id==100).update(data='sampledata') >

Re: [web2py] Returning a dict from a controller

2011-09-12 Thread Jonathan Lundell
On Sep 12, 2011, at 6:10 PM, Bruno Rocha wrote: > do you have response.generic_patterns = ['*'] in your models? The stock line (for security) is response.generic_patterns = ['*'] if request.is_local else [] > > On Mon, Sep 12, 2011 at 9:50 PM, HughBarker wrote: > Hi all, > So I've got a co

Re: [web2py] Re: Returning a dict from a controller

2011-09-12 Thread Jonathan Lundell
aven't compiled your app? No appname/compiled/ directory? In that case we want the second raise. Just before the raise, insert: badv = filename We *should* see a full path ending views/generic.html. > > > On Sep 13, 11:13 am, Jonathan Lundell wrote: >> On Sep 12, 2

Re: [web2py] [SLICE] nginx + SCGI

2011-09-13 Thread Jonathan Lundell
On Sep 13, 2011, at 2:10 AM, Michele Comitini wrote: > If you enjoy speed read the following web2pyslice.com: > > http://goo.gl/8ybpZ > > comments are welcome! Where would we see the improvements, compared (say) to a straight Apache mod_wsgi configuration?

Re: [web2py] python * function in Html Helpers

2011-09-13 Thread Jonathan Lundell
On Sep 13, 2011, at 10:10 AM, António Ramos wrote: > Hello, i dont understant quite well how to interpret the * in this code: It's just Python syntax: http://docs.python.org/tutorial/controlflow.html#unpacking-argument-lists > > > table = [['a', 'b'], ['c', 'd']] > 2 >>> print TABLE(*[TR(*r

Re: [web2py] Re: python * function in Html Helpers

2011-09-13 Thread Jonathan Lundell
On Sep 13, 2011, at 3:11 PM, Noel Villamor wrote: > I got the * and the ** explanations but António is asking about ***. It was just * in the original message. Must have gotten changed in the replies or something.

Re: [web2py] RPC Performance Testing with Sessions and SSL

2011-09-14 Thread Jonathan Lundell
On Sep 14, 2011, at 7:49 AM, Ross Peoples wrote: > I ran this test several times because of the HUGE difference between the > protocols when used over SSL. I think this may be more of a problem with the > JSON client or server rather than the protocol itself. You'll see what I mean: > I believ

Re: [web2py] RPC Performance Testing with Sessions and SSL

2011-09-14 Thread Jonathan Lundell
On Sep 14, 2011, at 7:49 AM, Ross Peoples wrote: > As you can see, there wasn't much of a change. In fact, turning off sessions > added about 400 ms to the testing time. Now let's try with SSL: > Have you done enough runs to know what kind of noise level you're getting? I'd be sort of surprise

Re: [web2py] RPC Performance Testing with Sessions and SSL

2011-09-14 Thread Jonathan Lundell
On Sep 14, 2011, at 8:41 AM, Ross Peoples wrote: > I have downloaded the jsonrpclib and rerun the SSL without Sessions test > again. MUCH better: Good. Another suggestion: insert some dummy request, a nop of some sort, as the first operation (before ADD). I'm guessing that in both cases (JSON

Re: [web2py] RPC Performance Testing with Sessions and SSL

2011-09-14 Thread Jonathan Lundell
On Sep 14, 2011, at 10:25 AM, Ross Peoples wrote: > Jonathan, > > Good point about the nop. The nop is on BOTH protocols and does not count > against the total time or the averages. Here are the results from that: I'm still puzzled by the anomalous JSON ADD time. How about dropping a second AD

Re: [web2py] RPC Performance Testing with Sessions and SSL

2011-09-14 Thread Jonathan Lundell
On Sep 14, 2011, at 10:47 AM, Ross Peoples wrote: > Ok, I think I've narrowed down the problem: > > I put the old db.py file back (the one from the welcome app), then I > commented everything. The percentage difference with everything commented out > is XML 293% faster. I started uncommenting l

Re: [web2py] RPC Performance Testing with Sessions and SSL

2011-09-14 Thread Jonathan Lundell
On Sep 14, 2011, at 11:07 AM, Anthony wrote: > On Wednesday, September 14, 2011 1:25:37 PM UTC-4, Ross Peoples wrote: > I also took Anthony's advice and removed all the models, except for three > lines from db.py that are required: > > from gluon.tools import Service > service = Service() > resp

Re: [web2py] RPC Performance Testing with Sessions and SSL

2011-09-14 Thread Jonathan Lundell
On Sep 14, 2011, at 11:16 AM, Ross Peoples wrote: > Normally, I wouldn't use that kind of percentage, except I wanted to > highlight the large gap between the two protocols with Auth is used. JSON-RPC > calls stay around 56 ms regardless of what I enable or disable in db.py. But > for some reas

Re: [web2py] RPC Performance Testing with Sessions and SSL

2011-09-14 Thread Jonathan Lundell
On Sep 14, 2011, at 11:29 AM, Anthony wrote: > On Wednesday, September 14, 2011 2:20:26 PM UTC-4, Jonathan Lundell wrote: >> >> How can the JSON times have increased (slightly) with the removal of all the >> db.py code? This seems odd. >> > > The JSON-vs-X

Re: [web2py] RPC Performance Testing with Sessions and SSL

2011-09-14 Thread Jonathan Lundell
I'm away from my sources for a while. I think you'll find the headers in request.headers. How about an rpc function that just returns them. On Sep 14, 2011, at 12:13 PM, Ross Peoples wrote: > I'll see if I can intercept the headers somehow. If you are interested in > seeing if this happens in

Re: [web2py] RPC Performance Testing with Sessions and SSL

2011-09-14 Thread Jonathan Lundell
On Sep 14, 2011, at 1:23 PM, Ross Peoples wrote: > I don't think request stores headers. I tried but couldn't find it in the > sources or through introspection. The response object has it, and I included > that here. Had to do some work arounds as just returning response.headers > generated a t

Re: [web2py] RPC Performance Testing with Sessions and SSL

2011-09-15 Thread Jonathan Lundell
On Sep 15, 2011, at 5:06 AM, Ross Peoples wrote: > Now, when I run the RPC services, this is what I get WITHOUT Auth (sorry, I > couldn't find a good way to format this): > Thanks, I can figure out something in an editor to look more closely. Something I don't understand. Massimo, do you? Anth

Re: [web2py] RPC Performance Testing with Sessions and SSL

2011-09-15 Thread Jonathan Lundell
On Sep 15, 2011, at 7:01 AM, Jonathan Lundell wrote: > On Sep 15, 2011, at 5:06 AM, Ross Peoples wrote: > >> Now, when I run the RPC services, this is what I get WITHOUT Auth (sorry, I >> couldn't find a good way to format this): >> > > Thanks, I can figure

Re: [web2py] RPC Performance Testing with Sessions and SSL

2011-09-15 Thread Jonathan Lundell
On Sep 15, 2011, at 8:04 AM, Ross Peoples wrote: > The way it is now, the JSON runs first, then the XML. I never interleaved the > two because I wanted to keep it simple. I can make the XML run first instead > and do another test: > > FINAL RESULTS > == > JSON-RP

Re: [web2py] RPC Performance Testing with Sessions and SSL

2011-09-15 Thread Jonathan Lundell
On Sep 15, 2011, at 8:45 AM, Ross Peoples wrote: > > 1. Auth and JSON-RPC > > - > > > > This problem stems from enabling Auth: > > > > auth = Auth(db) > > auth.define_tables() > > > > Whenever Auth is enabled, the average time per request for XML-RPC and > >

Re: [web2py] RPC Performance Testing with Sessions and SSL

2011-09-15 Thread Jonathan Lundell
On Sep 15, 2011, at 8:45 AM, Ross Peoples wrote: > The other big performance hit is that 2-3 places in web2py we do this: > > import contrib.simplejson as simplejson > > That really needs to change to something like this (with corresponding > changes to the code) > > try: > import json

Re: [web2py] RPC Performance Testing with Sessions and SSL

2011-09-15 Thread Jonathan Lundell
On Sep 15, 2011, at 10:09 AM, Ross Peoples wrote: > I think we can rule out the json serializer. I just replaced the code in > tools.py and serializers.py and tried this. I also confirmed that the C json > library was installed. There wasn't any change. However, I wonder if I should > send thos

Re: [web2py] RPC Performance Testing with Sessions and SSL

2011-09-15 Thread Jonathan Lundell
On Sep 15, 2011, at 11:31 AM, Ross Peoples wrote: > Well, the jsonrpclib you had me download is that one that I was using for all > of the testing, as it is certainly faster than the simplejsonrpc.py file. I > also like the fact that it follows the xmlrpclib logic. I have found it to be > more

Re: [web2py] RPC Performance Testing with Sessions and SSL

2011-09-15 Thread Jonathan Lundell
On Sep 15, 2011, at 10:49 AM, Ross Peoples wrote: > That is correct. I removed Auth from the model, and just added one dummy > table, and this table definition had the same effect of auth.define_tables(). > Then when I added "migrate=False" to my dummy table, the times for XML > dropped back do

Re: [web2py] Re: Trying to implement token authentication for web service

2011-09-16 Thread Jonathan Lundell
On Sep 16, 2011, at 10:02 AM, Eric wrote: > request.args(0) does not seem to work. When I try Massimo's > suggestion for a token check, I get the traceback below on the error > ticket. I've tested the database query, and it works fine. Also, the > service call works fine when I remove the token

Re: [web2py] Re: Trying to implement token authentication for web service

2011-09-16 Thread Jonathan Lundell
On Sep 16, 2011, at 10:35 AM, Eric wrote: > Hey, Ross. Your solution using request.vars.token worked. Thanks!! > > On Sep 15, 9:06 pm, Ross Peoples wrote: >> Eric, I may have found a way to do it, but it's not pretty. >> >> Create a controller that only has login / logout methods. The login m

Re: [web2py] Re: How to redirect user to original url he asked after login

2011-09-16 Thread Jonathan Lundell
On Sep 16, 2011, at 11:13 AM, Massimo Di Pierro wrote: > auto_redirect works for any redierct, even if not relative. > So you send an email like > > click here > http://./app/path > > and if http://./app/path requires login, you get redirected to > login but not back to http://./app/

Re: [web2py] Re: How to redirect user to original url he asked after login

2011-09-16 Thread Jonathan Lundell
On Sep 16, 2011, at 11:35 AM, Anthony wrote: > On Friday, September 16, 2011 2:21:07 PM UTC-4, Jonathan Lundell wrote: > > Sometimes I think the need for auto_redirect is paranoid. > > What's the hazard? Presumably there's nothing to stop the user from going to > the

Re: [web2py] Re: How to redirect user to original url he asked after login

2011-09-16 Thread Jonathan Lundell
direct? > > > > On Sep 16, 3:27 pm, Anthony wrote: >> On Friday, September 16, 2011 3:00:59 PM UTC-4, Jonathan Lundell wrote: >> >>> On Friday, September 16, 2011 2:21:07 PM UTC-4, Jonathan Lundell wrote: >> >>>> Sometimes I think the need fo

Re: [web2py] How to redirect user to original url he asked after login

2011-09-16 Thread Jonathan Lundell
I'm a little confused. The auth requires decorators redirect to (say) the login page, and stuff _next=URL() into vars. This is a bit of a hazard because vars can get corrupted in the outside world, and we check it somewhat (I'm not 100% convinced by the check, and it's all so not-DRY, but that'

Re: [web2py] Re: How to redirect user to original url he asked after login

2011-09-16 Thread Jonathan Lundell
On Sep 16, 2011, at 6:28 PM, Anthony wrote: > On Friday, September 16, 2011 4:56:17 PM UTC-4, Massimo Di Pierro wrote: > > should it just be? > > if not self.user: > if not session._auth_next: > session._auth_next = URL(args=request.args, >

Re: [web2py] How to disable escaping in @service

2011-09-16 Thread Jonathan Lundell
On Sep 16, 2011, at 8:38 PM, dlypka wrote: > I need something like > @service.json(escape=false) in my service: > > @service.json > def mytasks(a, b): >R = '{"completed_in":0.163,"max_id": > 112677442623246336,"max_id_str":"112677442623246336","next_page":"? > page=2&max_id=112677442623246336

Re: [web2py] Re: How to redirect user to original url he asked after login

2011-09-16 Thread Jonathan Lundell
ot url[0] == '/' and url[:4] != 'http' + I don't see how this can work, since the output of URL() typically (always?) starts with '/'. Doesn't it? > > On Sep 16, 8:44 pm, Jonathan Lundell wrote: >> On Sep 16, 2011, at 6:28 PM, Anthony wrote: &g

Re: [web2py] Re: How to redirect user to original url he asked after login

2011-09-16 Thread Jonathan Lundell
next = current.session._auth_next = None return next The startswith test: are we simply saying that if the startswith test is met, then we're already at the destination, so don't redirect? But shouldn't we be setting _auth_next to None in the redirection case? >

Re: [web2py] Re: How to redirect user to original url he asked after login

2011-09-17 Thread Jonathan Lundell
On Sep 17, 2011, at 7:51 AM, Massimo Di Pierro wrote: >> I also don't entirely understand this: >> >> def pop_next(self): >> next = current.session._auth_next >> if next and next.startswith(URL()): >> next = current.session._auth_next = None >> return next

Re: [web2py] Re: How to redirect user to original url he asked after login

2011-09-17 Thread Jonathan Lundell
On Sep 17, 2011, at 8:46 AM, Massimo Di Pierro wrote: > The basic use case is this: > User clicks on a link that requires_login and gets redirected to the > login page. After login the user is redirected to the original > requested page. > Exceptions: > - the login is outsourced to janrain > - the

Re: [web2py] Re: How to redirect user to original url he asked after login

2011-09-17 Thread Jonathan Lundell
On Sep 17, 2011, at 1:24 PM, Anthony wrote: > Sounds like this will be completely re-thought, so maybe comments on the > current (trunk) code aren't necessary, but here are some observations (not > sure if these are correct because I haven't tested anything, just quickly > looked at the code):

Re: [web2py] Re: Help Getting Cron Task to run

2011-09-23 Thread Jonathan Lundell
On Sep 23, 2011, at 8:28 AM, Lennon wrote: > Thanks for the update. > > So in that case the old Cron should still be working. Yes. > > Can anybody tell me if to use cron on linux running apache or windows > locally, is there any additional setup needed besides adding inserting > a line into cr

Re: [web2py] xml in response not well formed

2011-09-25 Thread Jonathan Lundell
FWIW, it looks to me like the extra lines are left over from a previous response (or something like that) and not being generated by this particular invocation of the view. Why that would happen I have no idea. On Sep 25, 2011, at 2:38 PM, Martin wrote: > Hello All, sorry for the bother I am

Re: [web2py] Re: xml in response not well formed

2011-09-25 Thread Jonathan Lundell
On Sep 25, 2011, at 3:52 PM, Martin wrote: > yes, you are right, because the variables for the following xml part > it suppose to be not available for current request, which corresponds > to operation == 'get_leafs'... Can you get a look at the Content-length header of the response? > > 1.0 >

Re: [web2py] Re: xml in response not well formed

2011-09-25 Thread Jonathan Lundell
On Sep 25, 2011, at 4:32 PM, Martin wrote: > Response Headers > X-Powered-By web2py > Set-Cookiesession_id_nems_web=127.0.0.1-1c024dc8-7db7-440c-a45e- > d57de93d8879; Path=/ > Expires Sun, 25 Sep 2011 23:30:33 GMT > Pragmano-cache > Cache-Control no-store, no-cache, must-revalid

Re: [web2py] Re: web2py 1.99.2 is OUT

2011-09-26 Thread Jonathan Lundell
On Sep 26, 2011, at 7:20 AM, Ross Peoples wrote: > I think SSL is broken (and so is Google Groups as this will be my second > post. The first one didn't seem to make it). I just did a web2py update to > the latest trunk version and haven't done an update since x509 was added. I > think the x509

Re: [web2py] Re: web2py 1.99.2 is OUT

2011-09-26 Thread Jonathan Lundell
On Sep 26, 2011, at 8:27 AM, Ross Peoples wrote: > It was the admin application, which should be using HTTPS when you access it > over HTTPS right? I just tried with a test app and the same thing happens. > > I commented out like 518 in rocket.py and that silences the errors, but is > that a go

Re: [web2py] Re: web2py 1.99.2 is OUT

2011-09-26 Thread Jonathan Lundell
#x27;re right here; at the very least the code should have been more specific about the errors it was ignoring. And the "detected by Worker" comment is at least suspect. > > mic > > > 2011/9/26 Jonathan Lundell : >> On Sep 26, 2011, at 8:27 AM, Ross Peoples wrot

Re: [web2py] Re: web2py 1.99.2 is OUT

2011-09-26 Thread Jonathan Lundell
On Sep 26, 2011, at 10:11 AM, Timothy Farrell wrote: > I guess I could expound upon that a little more. Rocket does not > allow insecure connections on secure sockets. So if a secure > connection fails for whatever reason it will fail (here > https://github.com/explorigin/Rocket/blob/master/rock

Re: [web2py] Re: Never happened before Rocket errors come up. version 1.98.2

2011-09-26 Thread Jonathan Lundell
On Sep 26, 2011, at 1:30 PM, Massimo Di Pierro wrote: > Other than the error, do you see wrong behavior from the browser? > I do not not believe that there is anything wrong as we ship the > "official" rocket. We are just printing an exception that before was > being ignored. I don't think this i

Re: [web2py] Re: Never happened before Rocket errors come up. version 1.98.2

2011-09-26 Thread Jonathan Lundell
On Sep 26, 2011, at 1:42 PM, Massimo Di Pierro wrote: > It is not but it may be raised at the same point. > It is important to determine which rocket version did not cause the > error so we can look at differences. The added line only logs SSLError, FWIW. > > On Sep 26, 3:

Re: [web2py] Re: 1.99 gluon/tools.py replace_id mishandling url [SOLVED]

2011-09-28 Thread Jonathan Lundell
On Sep 28, 2011, at 8:10 AM, Anthony wrote: > I think this is still a bug, though. Shouldn't that have been: @auth.requires_login @requires_session_option def index(): return dict() ? > > On Wednesday, September 28, 2011 10:17:26 AM UTC-4, Jim Karsten wrote: > I found a work around.

Re: [web2py] Re: help on routes

2011-09-28 Thread Jonathan Lundell
On Sep 28, 2011, at 9:09 PM, Bruno Rocha wrote: > I am sure something have changed on this, > I used this same setup before and worked well.. > > works here: www.serafimnatural.com.br (web2py 1.82.x) > > but not here: pythonbrasil.web2py.com.br > > --- > default_

Re: [web2py] help on routes

2011-09-28 Thread Jonathan Lundell
On Sep 28, 2011, at 8:00 PM, Bruno Rocha wrote: > With this setup, I have no access to admin... > > https://pythonbrasil.web2py.com.br/admin/design/pytalks > > This worked before, any change on routes? > > -

Re: [web2py] help on routes

2011-09-28 Thread Jonathan Lundell
On Sep 28, 2011, at 9:31 PM, Bruno Rocha wrote: > Ok, now I got it to work with this: > > routers = dict( > # base router > BASE = dict( > default_application = 'pytalks', > default_controller = 'default', > controllers=['appadmin','default'], > application

Re: [web2py] uwsgi question

2011-09-29 Thread Jonathan Lundell
On Sep 29, 2011, at 7:36 AM, Vasile Ermicioi wrote: > /home/my_user/bin/python2.7 uwsgiconfig.py --build > > but I did so > > will that work > > export LD_LIBRARY_PATH=/home/my_user/lib/python2.7 > > then running the uwsgi command? > A note of caution when modifying LD_LIBRARY_PATH: like PAT

Re: [web2py] get rid of default function from URL

2011-09-30 Thread Jonathan Lundell
On Sep 30, 2011, at 8:52 AM, Marek Mollin wrote: > I am trying to explicitly define what type of URL I wish to see. > Since there are default route mappings I cannot figure why it always > bounds index as default function even if I URL(c='something', f='') or > URL(c='something', f=None). > > As

Re: [web2py] Re: can i "import" db into module?

2011-09-30 Thread Jonathan Lundell
On Sep 30, 2011, at 12:16 PM, howesc wrote: > Thanks for the help guys! i knew it was in there hiding > > for reference, here is what i did (i'm running on GAE): > > in db.py: > from gluon.globals import current > db = DAL('gae') # connect to Google BigTable > curr

Re: [web2py] can i "import" db into module?

2011-09-30 Thread Jonathan Lundell
On Sep 30, 2011, at 5:34 PM, Anthony wrote: > On Friday, September 30, 2011 3:28:23 PM UTC-4, Jonathan Lundell wrote: > > We discussed a while back formalizing this, perhaps with a current.apps > dict/Storage predefined (you'd use current.apps.myappname in that case), but &

Re: [web2py] Subdomain based on blog users in routes.py

2011-10-01 Thread Jonathan Lundell
On Sep 28, 2011, at 8:13 PM, Farsheed Ashouri wrote: > Hi everyone, I have a blog system and I need a pages like: > mysite.com/myappName/pages/blog?u=user1 > map to something like this: > user1.mysite.com > > I've read many posts here, the book and other resources i idea how this > regexpr thing

Re: [web2py] Subdomain based on blog users in routes.py

2011-10-01 Thread Jonathan Lundell
On Oct 1, 2011, at 2:13 PM, Farsheed Ashouri wrote: > I think i have no problem with DNS. cause i put a * value in subdomain > setting of DNS and now i have access to any sub-domain i want. > So you say there is no way to solve this in routes.py? With the regex mode, perhaps.

Re: [web2py] Subdomain based on blog users in routes.py

2011-10-01 Thread Jonathan Lundell
On Oct 1, 2011, at 3:13 PM, Jonathan Lundell wrote: > On Oct 1, 2011, at 2:13 PM, Farsheed Ashouri wrote: > >> I think i have no problem with DNS. cause i put a * value in subdomain >> setting of DNS and now i have access to any sub-domain i want. >> So you say there is

Re: [web2py] Subdomain based on blog users in routes.py

2011-10-02 Thread Jonathan Lundell
t from a particular user must come in on that user's subdomain, or if not, there'd need to be a redirection to get it there. I think. > > Anthony > > On Saturday, October 1, 2011 6:23:10 PM UTC-4, Jonathan Lundell wrote: > On Oct 1, 2011, at 3:13 PM, Jonathan Lundell wrote: &g

Re: [web2py] Subdomain based on blog users in routes.py

2011-10-05 Thread Jonathan Lundell
On Oct 5, 2011, at 7:36 AM, Farsheed Ashouri wrote: > ya, It works, but it's not was i expected. for example my own blog > rodmena.ourway.ir now redirects to it's correct path, but i wanted to stay at > sub domain level while surfing. > my code is simple: > > # Blogs subdomain redirection =

Re: [web2py] Subdomain based on blog users in routes.py

2011-10-05 Thread Jonathan Lundell
On Oct 5, 2011, at 8:03 AM, Farsheed Ashouri wrote: > Well it worked!! but with many problems in Ajax loading! Thank you, but any > improvements?? You might want to look at request.controller (and .function and .extension) to detect Ajax requests and do something else with them (depending on wh

<    1   2   3   4   5   6   7   8   9   10   >