Re: [web2py] Simple BASE in routes.py gives me invalid request

2013-08-29 Thread Wei Wang
Jonathan,

I am embarrassed to report that is has been a user error -- my fault -- 
that I got two different versions of web2py running in the same instance of 
apache2. I didn't think to check my Apache configuration until I downloaded 
a stable version of the source, set it up and ran it manually, then the 
problem went away.

Your attention and support has been wonderful and much appreciated.

-- 

--- 
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/groups/opt_out.


Re: [web2py] Simple BASE in routes.py gives me invalid request

2013-08-29 Thread Jonathan Lundell
On 29 Aug 2013, at 6:37 AM, Wei Wang ww9riv...@gmail.com wrote:
 I am embarrassed to report that is has been a user error -- my fault -- that 
 I got two different versions of web2py running in the same instance of 
 apache2. I didn't think to check my Apache configuration until I downloaded a 
 stable version of the source, set it up and ran it manually, then the problem 
 went away.
 
 Your attention and support has been wonderful and much appreciated.

I'm glad you tracked it down. Good trick, though!

-- 

--- 
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/groups/opt_out.


Re: [web2py] Simple BASE in routes.py gives me invalid request

2013-08-29 Thread Jonathan Lundell
On 29 Aug 2013, at 6:37 AM, Wei Wang ww9riv...@gmail.com wrote:
 I am embarrassed to report that is has been a user error -- my fault -- that 
 I got two different versions of web2py running in the same instance of 
 apache2. I didn't think to check my Apache configuration until I downloaded a 
 stable version of the source, set it up and ran it manually, then the problem 
 went away.
 
 Your attention and support has been wonderful and much appreciated.

One thing you still might do, though, as long as you're in testing mode: would 
you please try a request that is missing its view, but is otherwise OK? 

That's because, among your symptoms, you were getting an invalid request 
response with no details as to what was invalid. I'd like to track that down, 
because it's not a very helpful message, and there were some hints in your 
reports that it was associated with a missing view.

Thanks. And if it doesn't show up, just let me know and don't spend more time 
on it.

-- 

--- 
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/groups/opt_out.


Re: [web2py] Simple BASE in routes.py gives me invalid request

2013-08-28 Thread Wei Wang
Just got a chance to try this: I copied the 
midash/views/default/user.html tomiops/views/default/user.html, 
reloaded the page at /midash/user/login?_next=/midash/default/index, my 
user login page shows up.

So I guess there is a bug somewhere in the routing code.

-- 

--- 
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/groups/opt_out.


Re: [web2py] Simple BASE in routes.py gives me invalid request

2013-08-28 Thread Jonathan Lundell
On 28 Aug 2013, at 2:28 PM, Wei Wang ww9riv...@gmail.com wrote:
 Just got a chance to try this: I copied the midash/views/default/user.html 
 tomiops/views/default/user.html, reloaded the page at 
 /midash/user/login?_next=/midash/default/index, my user login page shows up.
 
 So I guess there is a bug somewhere in the routing code.

Interesting. 

Three requests: would you please re-post your route dictionary, and summarize 
the behavior you're seeing (including the latest, and the specific error 
messages)? This thread has gotten a little strung out...

Second, what happens if you leave off the query string ('?' and all after it)? 
I'm guessing nothing, but I'd like to check.

There appears to be a minor problem (recent, I'm guessing) with the error 
reporting as well. You're seeing the bad function properly reported, but no 
details on what appears to be a bad view (or bad view routing).

Third, look at both your controllers/ directories and make sure there aren't 
any files there that you don't expect. This is because, by default, the router 
uses the files in controllers/ in its logic.

-- 

--- 
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/groups/opt_out.


[web2py] Simple BASE in routes.py gives me invalid request

2013-08-27 Thread Wei Wang
Here is the entire routes.py I have:

routers = dict(
BASE=dict(
default_application='miops',
),
)

logging = 'debug'

if __name__ == '__main__':
import doctest
doctest.testmod()


I am testing the web2py (Version 
2.6.0-development+timestamp.2013.08.15.10.05.27) instance under Apache2 
using mod_python and modpythonhandler came with web2py.

I have 2 simple apps: midash and miops. I intend to require user 
authentication for accessing midash and not miops.

In miops/controllers/default.py I have only an index() function, while 
in midash/controllers/default.py I do have a user() function.

A path of midash/default/user/login?_next=/midash gives me an invalid 
request error.

I put some test cases in routes.py, they seem to work fine:

'''
 import sys
 import os
 path = os.path.dirname(os.path.abspath(__file__))
 sys.path = [path] + [p for p in sys.path if not p == path]
 os.chdir(path)
 import gluon.main
 from gluon.rewrite import load, filter_url, filter_err, 
get_effective_router
 load(routes=os.path.basename(__file__))
...
 filter_url('http://domain.com/')
'/miops/default/index'
 filter_url('http://domain.com/miops/apps?app=abc')
'/miops/apps/index ?app=abc'
 filter_url('http://domain.com/midash/default/user/login?_next=/midash')
/midash/default/user ['login'] ?_next=/midash
'''



Thank you very much for your help.

-- 

--- 
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/groups/opt_out.


Re: [web2py] Simple BASE in routes.py gives me invalid request

2013-08-27 Thread Jonathan Lundell
On 27 Aug 2013, at 9:47 AM, Wei Wang ww9riv...@gmail.com wrote:
 Here is the entire routes.py I have:
 
 routers = dict(
 BASE=dict(
 default_application='miops',
 ),
 )
 
 logging = 'debug'
 
 if __name__ == '__main__':
 import doctest
 doctest.testmod()
 
 
 I am testing the web2py (Version 
 2.6.0-development+timestamp.2013.08.15.10.05.27) instance under Apache2 using 
 mod_python and modpythonhandler came with web2py.
 
 I have 2 simple apps: midash and miops. I intend to require user 
 authentication for accessing midash and not miops.
 
 In miops/controllers/default.py I have only an index() function, while in 
 midash/controllers/default.py I do have a user() function.
 
 A path of midash/default/user/login?_next=/midash gives me an invalid 
 request error.

Is there more to the error message?

 
 I put some test cases in routes.py, they seem to work fine:
 
 '''
  import sys
  import os
  path = os.path.dirname(os.path.abspath(__file__))
  sys.path = [path] + [p for p in sys.path if not p == path]
  os.chdir(path)
  import gluon.main
  from gluon.rewrite import load, filter_url, filter_err, 
  get_effective_router
  load(routes=os.path.basename(__file__))
 ...
  filter_url('http://domain.com/')
 '/miops/default/index'
  filter_url('http://domain.com/miops/apps?app=abc')
 '/miops/apps/index ?app=abc'
  filter_url('http://domain.com/midash/default/user/login?_next=/midash')
 /midash/default/user ['login'] ?_next=/midash
 '''
 
 
 
 Thank you very much for your help.
 
 -- 
  



-- 

--- 
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/groups/opt_out.


Re: [web2py] Simple BASE in routes.py gives me invalid request

2013-08-27 Thread Wei Wang


On Tuesday, August 27, 2013 12:54:51 PM UTC-4, Jonathan Lundell wrote:

 On 27 Aug 2013, at 9:47 AM, Wei Wang ww9r...@gmail.com javascript: 
 wrote:

 I have 2 simple apps: midash and miops. I intend to require user 
 authentication for accessing midash and not miops.

 In miops/controllers/default.py I have only an index() function, while 
 in midash/controllers/default.py I do have a user() function.

 A path of midash/default/user/login?_next=/midash gives me an invalid 
 request error.


 Is there more to the error message? 


No. That's all.

I did a view page source in Chrome, the entire page is just htmlbody
h1invalid request/h1/body/html.

-- 

--- 
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/groups/opt_out.


Re: [web2py] Simple BASE in routes.py gives me invalid request

2013-08-27 Thread Jonathan Lundell
On 27 Aug 2013, at 10:38 AM, Wei Wang ww9riv...@gmail.com wrote:
 On Tuesday, August 27, 2013 12:54:51 PM UTC-4, Jonathan Lundell wrote:
 On 27 Aug 2013, at 9:47 AM, Wei Wang ww9r...@gmail.com wrote:
 I have 2 simple apps: midash and miops. I intend to require user 
 authentication for accessing midash and not miops.
 
 In miops/controllers/default.py I have only an index() function, while 
 in midash/controllers/default.py I do have a user() function.
 
 A path of midash/default/user/login?_next=/midash gives me an invalid 
 request error.
 
 Is there more to the error message? 
 
 No. That's all.
 
 I did a view page source in Chrome, the entire page is just 
 htmlbodyh1invalid request/h1/body/html.
 
 

What version of web2py are you running?

-- 

--- 
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/groups/opt_out.


Re: [web2py] Simple BASE in routes.py gives me invalid request

2013-08-27 Thread Wei Wang
VERSION = Version 2.6.0-development+timestamp.2013.08.15.10.05.27

On Tuesday, August 27, 2013 2:04:54 PM UTC-4, Jonathan Lundell wrote:

 On 27 Aug 2013, at 10:38 AM, Wei Wang ww9r...@gmail.com javascript: 
 wrote:

 On Tuesday, August 27, 2013 12:54:51 PM UTC-4, Jonathan Lundell wrote:

 On 27 Aug 2013, at 9:47 AM, Wei Wang ww9r...@gmail.com wrote:

 I have 2 simple apps: midash and miops. I intend to require user 
 authentication for accessing midash and not miops.

 In miops/controllers/default.py I have only an index() function, 
 while in midash/controllers/default.py I do have a user() function.

 A path of midash/default/user/login?_next=/midash gives me an invalid 
 request error.


 Is there more to the error message? 


 No. That's all.

 I did a view page source in Chrome, the entire page is just html
 bodyh1invalid request/h1/body/html.



 What version of web2py are you running?


-- 

--- 
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/groups/opt_out.


Re: [web2py] Simple BASE in routes.py gives me invalid request

2013-08-27 Thread Jonathan Lundell
On 27 Aug 2013, at 11:24 AM, Wei Wang ww9riv...@gmail.com wrote:
 VERSION = Version 2.6.0-development+timestamp.2013.08.15.10.05.27

Generally, there should be an indication of a specific error, which we're not 
seeing here. But the logic for error reporting has changed recently, so...

Please try an access to a controller or function you know is missing (with no 
other arguments), and see if you get a more specific error.

For example, try /midash/xxx/yyy and /midash/default/xxx.

 
 On Tuesday, August 27, 2013 2:04:54 PM UTC-4, Jonathan Lundell wrote:
 On 27 Aug 2013, at 10:38 AM, Wei Wang ww9r...@gmail.com wrote:
 On Tuesday, August 27, 2013 12:54:51 PM UTC-4, Jonathan Lundell wrote:
 On 27 Aug 2013, at 9:47 AM, Wei Wang ww9r...@gmail.com wrote:
 I have 2 simple apps: midash and miops. I intend to require user 
 authentication for accessing midash and not miops.
 
 In miops/controllers/default.py I have only an index() function, while 
 in midash/controllers/default.py I do have a user() function.
 
 A path of midash/default/user/login?_next=/midash gives me an invalid 
 request error.
 
 Is there more to the error message? 
 
 No. That's all.
 
 I did a view page source in Chrome, the entire page is just 
 htmlbodyh1invalid request/h1/body/html.
 
 
 
 What version of web2py are you running?
 
 


-- 

--- 
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/groups/opt_out.


Re: [web2py] Simple BASE in routes.py gives me invalid request

2013-08-27 Thread Wei Wang
/midash/xyz/abc gives me invalid function (default/xyz).

/midash/default/abcdefg gives me invalid function (default/abcdefg).

I just tried with a copy of the user function from 
midash/controllers/default.py to miops/controllers/default.py. That 
gives me an error message that may be telling:

invalid view (default/user.html)
That seems to mean that the URI /midash/default/user/login?_next=/midash 
somehow got routed to /miops/default/user/login -- The reason for my 
suspicion is that I do have a midash/views/default/user.html but no 
user.html anywhere in miops.

-- 

--- 
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/groups/opt_out.