[web2py] Re: Web2py, react, typescript, visual studio code setup

2020-03-13 Thread Larry Weinberg
Thanks for letting me know of the error.  The folder was supposed to be 
named "reactsrc" but I forgot to change it in this repo.  It's fixed now.

On Friday, March 13, 2020 at 5:40:00 AM UTC-7, Alex Beskopilny wrote:
>
>
> Thanks Larry!  great example.
>
> maybe in  *webpack.config.js*
>
> *- app: './static/reactsrc/index.tsx'*
> + app: './static/src/index.tsx'
>
> среда, 11 марта 2020 г., 18:59:40 UTC+3 пользователь Larry Weinberg 
> написал:
>>
>>
>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/8fa09068-0a3f-4812-81ea-6fdea8fa4600%40googlegroups.com.


[web2py] Web2py, react, typescript, visual studio code setup

2020-03-11 Thread Larry Weinberg
Several people have asked about how to set up web2py to work with React 
(and Typescript) on the front end. Others have asked how to use an IDE like 
Visual Studio Code with web2py. I have a setup that I've posted to github 
that has the basics in place for doing this with a pre-configured Visual 
Studio Code workspace and instructions on how to get it up and running.  
 Web2py running inside VSCode is really easy to work with and debug!

https://github.com/larrywberg/web2py-react-ts-vscode

I am not an expert on Visual Studio Code, or React, or Typescript, or 
web2py so I would be happy to get feedback to improve it.  I hope this is 
useful for others.  It is using React with React Hooks for state 
management.  There is a sample REST call set up.

I hooked in a webpack dev server in addition to the web2py server so that 
the react sample code can be iterated on quickly if you so choose.  You can 
debug the python server and the Typescript client at the same time in 
VSCode if you launch them both from the preconfigured launch tasks. You can 
also use the Web2py admin interface to edit files in parallel with editing 
them in VS Code when running locally.  There are other preconfigured 
scripts set up and you can also trigger the compile of the react code from 
a menu item in the sample code.





-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/0dc1a393-0bee-4e49-bf4d-8cd252c0dea7%40googlegroups.com.


Re: [web2py] Re: web2py_osx on Sierra (OSX 10.12)

2017-01-02 Thread Larry Weinberg
I see this happening too.  After allowing the app to run,  web2py stops 
working and the console errors look like this.  Is sqlite the problem?

error 11:49:43.484984 -0800 mtmd Can't trash .MobileBackups while MTM 
Snapshot Handler is running!
error 11:49:43.599957 -0800 com.apple.quicklook.ThumbnailsAgent getattrlist 
returned -1 Invalid argument
error 11:49:43.625833 -0800 geodMachServiceBridge 22.1 Asked to free space 
for a volume we don't control.
error 11:49:43.627489 -0800 com.apple.quicklook.ThumbnailsAgent SQLite[1]: 

error 11:49:43.627896 -0800 com.apple.quicklook.ThumbnailsAgent Sqlite 
request  failed on  with error []
error 11:49:44.285813 -0800 web2py Detected missing constraints for 
.  It cannot be placed because there are not enough constraints to 
fully define the size and origin. Add the missing constraints, or set 
translatesAutoresizingMaskIntoConstraints=YES and constraints will be 
generated for you. If this view is laid out manually on macOS 10.12 and 
later, you may choose to not call [super layout] from your override. Set a 
breakpoint on DETECTED_MISSING_CONSTRAINTS to debug. This error will only 
be logged once.


On Saturday, December 31, 2016 at 6:54:08 AM UTC-8, Jared McFarland wrote:
>
> https://github.com/web2py/web2py/issues/1551
>
> On Saturday, November 26, 2016 at 5:18:46 AM UTC+1, Massimo Di Pierro 
> wrote:
>>
>> Thanks for reporting this. Do you mind opening a ticket?
>>
>> On Monday, 21 November 2016 09:42:54 UTC-6, Jared McFarland wrote:
>>>
>>> I've also run into this. I'm on macOS 10.12.1
>>>
>>> I downloaded the web2py app from 
>>> http://www.web2py.com/examples/static/web2py_osx.zip
>>>
>>> When I try to run it, I get the same web2py error dialog: 
>>> http://take.ms/IIXG5
>>>
>>> Here are the details from the console: http://take.ms/tTTgG
>>>
>>> "Detected missing constraints for .  It cannot be placed 
>>> because there are not enough constraints to fully define the size and 
>>> origin. Add the missing constraints, or set 
>>> translatesAutoresizingMaskIntoConstraints=YES and constraints will be 
>>> generated for you. If this view is laid out manually on macOS 10.12 and 
>>> later, you may choose to not call [super layout] from your override. Set a 
>>> breakpoint on DETECTED_MISSING_CONSTRAINTS to debug. This error will only 
>>> be logged once."
>>>
>>>
>>>
>>> On Sunday, October 30, 2016 at 1:09:58 PM UTC+1, Scott Hunter wrote:

 I downloaded a fresh copy of the source version, ran it using the 
 default python in OS X, and all ran fine.

 I installed Anaconda python 2.7, ran the source version using it, and 
 all ran fine.

 However, I was able to run the OS X version by executing the 
 Content/MacOS/web2py executable inside of web2py.app via the command line.

 Then I tried executing that same OS X version by double-clicking the 
 app; it presented me with a different dialog: that it was from an unknown 
 developer, and would not open it.  But I could open it from the Security 
 panel of System Preferences, and it worked fine.

 I next tried to download the same .zip file from a different server (as 
 my ultimate goal is to distribute my appliance via such an executable). 
  That exhibited the problematic behavior that I have reported previously.

 Lastly, I re-downloaded the zipped-app from the web2py site; opening 
 that (via double-clicking) is now experiencing the behavior previously 
 reported.  But I *can* open it via the command line as described above. 
  And after doing so, it will open via double-click.

 So the "source" of the problem seems to have been trying to download 
 from a different server.  WHY that would cause a problem, I haven't a 
 clue. 
  But I could get around it by adding a script to open the execrable 
 directly.

 - Scott


 On Saturday, October 29, 2016 at 10:42:08 PM UTC-4, Massimo Di Pierro 
 wrote:
>
> I would recommend you download Anaconda python 2.7 and run python from 
> source
> http://web2py.com/examples/static/web2py_src.zip
>
> If it also fails, it may give more info.
>
> On Tuesday, 25 October 2016 11:55:32 UTC-5, Scott Hunter wrote:
>>
>> Sure, but there's not much to see.
>>
>> When I launch the app (after Safari, presumably, has unzipped it), I 
>> get:
>>
>>
>> 
>>
>> I click Open, and (after a little wait) am presented with:
>>
>>
>> 
>>
>> If there is something relevant in the Console, it isn't obvious to me.
>>
>> - Scott
>>

[web2py] Re: Dreamhost Passenger setup not working

2014-12-10 Thread Larry Weinberg
On dreamhost I did the following after enabling passenger:

I placed all web2py files in root folder of website (not the public folder) 
 e.g. my.subdomain.com/

I copied handlers/wsgihandler.py to passenger_wsgi.py

I edited passenger_wsgi.py:


Added:

import sys

import os


INTERP = /usr/bin/python

if sys.executable != INTERP:

os.execl(INTERP, INTERP, *sys.argv)

I commented out this line (MAY BE IMPORTANT):

# sys.stdout = sys.stderr


created tmp/ folder under my web root folder
did a touch restart.txt to get passenger to reload

site loaded

-- 
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: RSVP: Massimo @ Bay Area web2py meetup (refreshments) -- 12/5/2014, 6:30PM - 9:00PM -- BE THERE!!!

2014-11-09 Thread Larry Weinberg
I hope to make it.

On Wednesday, November 5, 2014 11:48:14 PM UTC-8, weheh wrote:

 Hi Bay Area web2py'ers. Get excited!

 *Massimo will attend our very own Bay Area* *web2py meetup* to meet, 
 greet and present. Additional talks are planned. Details follow:

 Date: *Friday, December 5*
 Time: *6:30PM to 9:00PM*
 Location: *1125 Jackson Street, Albany, CA (directly off the Buchanan 
 freeway ramp)*
 Sponsor: *YAKiToMe.com* (a development-stage web2py-based TTS app)
 Cost: *Free*
 RSVP: *please RSVP by replying inline to this post*
 Parking: Plentiful free parking is readily available directly in front of 
 the meeting room

 *Agenda: *We'll have an informal mixer from 6:30PM to 7:00PM, with 
 refreshments (like pizza and drinks). Then, a 1 hour talk by Massimo and 
 hopefully two 20-minute volunteered talks.

 *Call for Talks*: Please volunteer to give a talk. Or a 5 minute 
 lightning pitch for your web2py app or cool web2py trick. Please let me 
 know privately or via a posting here.

 *Equipment Needs: *We will need a digital projector that can plug into a 
 laptop. If you are coming and can lend a working projector for the night, 
 please let me know as it would be much appreciated. Otherwise, I will have 
 to rent one. If you are giving a presentation, please plan on bringing your 
 own laptop. I will have a Windows laptop available just in case.

 *Spread The Word*. If you belong to the python user's group in San 
 Francisco or elsewhere in the Bay Area or are a member of a Django, Drupal, 
 Ruby or other web framework user's group, please help spread the word about 
 this meetup. This posting will be the official organizing document for the 
 meetup, so post your questions and comments here.

 Thanks, and hope to meet a bunch of web2py'ers on December 5!


-- 
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: web2py meetup with Massimo in north Bay Area

2014-10-30 Thread Larry Weinberg
Any Update on finalizing this date?

On Tuesday, September 23, 2014 9:04:07 AM UTC-7, weheh wrote:

 Massimo can not commit to a date yet, but his best guess is December 5. 
 Pencil it into your calendar please: Friday December 5, 6PM to 9PM. 
 Location, Berkeley CA. THIS IS AN ESTIMATE ONLY AND TENTATIVE.

 On Monday, September 15, 2014 7:18:48 PM UTC-7, weheh wrote:

 Target early December. How much interest? Looking for another speaker. 

 Will try to leverage python user's group. Otherwise, I have a nice room 
 on UC Berkeley campus large enough for 20+.

 Trying to get a measure of the audience. 1 additional volunteer speaker 
 requested.



-- 
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: web2py meetup with Massimo in north Bay Area

2014-09-21 Thread Larry Weinberg
I will also try to attend if it's in early December


On Monday, September 15, 2014 7:18:48 PM UTC-7, weheh wrote:

 Target early December. How much interest? Looking for another speaker. 

 Will try to leverage python user's group. Otherwise, I have a nice room on 
 UC Berkeley campus large enough for 20+.

 Trying to get a measure of the audience. 1 additional volunteer speaker 
 requested.


-- 
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] Problem (and solution) with wsgihandler.py on Passenger Phusion + Apache

2014-05-24 Thread Larry Weinberg
I have experienced and fixed a problem with wsgihandler.py when using the 
latest Passenger Phusion and Apache.

Dreamhost automatically upgraded the Phusion on my server and this 
immediately broke a couple of my web2py sites.

It boiled down to the following line in the web2py-provided wsgihandler.py:

sys.stdout = sys.stderr

If I comment out this line then Phusion works again.  
With that line in place it spends about 90 seconds trying to launch the 
site and eventually comes back stating that there was no response from the 
site.

Does anyone know what functionality I may lose in web2py with this line 
removed?

Thanks,

Larry

-- 
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: SQLFORM.grid, how to edit non-visible field in the onvalidate function?

2014-02-08 Thread Larry Weinberg
 will one of these work?

form.element('input',_name=field_hidden)['_type'] = hidden

form.element('input[name=field_hidden]')['_type'] = hidden

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


[web2py] Re: Can't edit default.py after upgrade to 2.8.2

2013-12-11 Thread Larry Weinberg
This is happening periodically for me for the last several releases of 
web2py.  Using apache on centos.  
Sometimes I reload the editing page and it works.  Often the tab for the 
file will show up with no contents.  If I click on the tab, the contents 
sometimes show up.

Seems like some ajax calls may be crossing paths or something because it's 
not consistent.


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


[web2py] Re: Restful API with HTTPS and authentication

2013-09-16 Thread Larry Weinberg
I'm doing exactly that and not running into troubles.
Could it be something about your SSL certificate?  If it's not a well 
trusted certificate sometimes you need to install it on the client side.
Does it match the domain name you are calling?

I test my server with the following python code and I can use basic 
authentication with restful calls:

import requests
from   requests.auth import HTTPBasicAuth
import json

user  = 'myn...@my.com'
passwd = 'mypassword'
url= 'http://mysrver/app/controller/resfullcall.json'
r   = requests.get(url, auth=HTTPBasicAuth(user, passwd))
# print r.text

# Decode the JSON response and get the access token
decodedDict = json.loads(r.text)


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


[web2py] Re: CAS provider and registration

2013-08-29 Thread Larry Weinberg
I can get the register to redirect as I wanted by adding this to the CAS 
server application's default controller index function:

   if session.service_arg:
redirect(session.service_arg)

The only thing missing then is the register button.  It should be 
relatively trivial to add that in.

I would think it would be nice to have this all work by default or add to 
the book's section on CAS.





-- 

--- 
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] Re: CAS provider and registration

2013-08-28 Thread Larry Weinberg

It look like trunk gives the same results.

   - I create two new apps up casserve and casclient
   - In casclient I create auth with this:
  - auth = Auth(db,cas_provider = 
  'http://127.0.0.1:8000/casserve/default/user/cas')
   - I launch casclient/default/index and the login menu only shows login. 
No registration.
   - If I go to login it takes me to casserve.  There I can go to 
   registration in the menu but it does not take me back to casclient once I 
   log in. It takes me to casserve/default/index

What I would wish/expect would happen is one of:

   - Cas client would show both login and  register choices that would 
   redirect to casserve for login or registration and would return to 
   casclient when done
   
or

   - Cas client would show a single login or register choice which would 
   take me to casserve.  Once logged in or registered I would return to 
   casclient




-- 

--- 
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] Re: CAS provider and registration

2013-08-27 Thread Larry Weinberg
I'm using 2.5.1

Once I set up the client to use the CAS provider, the registration options 
go away on the client.

-- 

--- 
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] Re: CAS provider and registration

2013-08-27 Thread Larry Weinberg
Thanks Massimo.  I will try that


On Tuesday, August 27, 2013 1:12:47 PM UTC-7, Massimo Di Pierro wrote:

 I believe this is fixed in trunk. You have to update web2py and the 
 views/default/users.html in your provider app.

 On Tuesday, 27 August 2013 09:33:45 UTC-5, Larry Weinberg wrote:

 I'm using 2.5.1

 Once I set up the client to use the CAS provider, the registration 
 options go away on the client.



-- 

--- 
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] CAS provider and registration

2013-08-26 Thread Larry Weinberg
I've followed instructions elsewhere and set up a CAS provider application 
and a client application that uses the CAS service.
It looks like the registration options go away from the client app in this 
flow.

Once on the CAS provider login screen, I can navigate to registration 
choice, but when it's done it does not direct back to the client app.

If this a limitation inherent in the web2py flow? 

Is this being worked on?


-- 

--- 
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] Re: auth.requires(True,requires_login=False) does not work

2013-08-24 Thread Larry Weinberg
I figured it out.

I needed to add arguments to GET().  That's where the problem was coming 
from because I was sending in a value on the curl command.
I think it's working now.

Sorry for the noise.

-- 

--- 
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] auth.requires(True,requires_login=False) does not work

2013-08-23 Thread Larry Weinberg
It seems that the requires_login option for @auth.requires() does not work. 
 Should it?
Is there another way to make this work for restful calls?  I want to 
implement a token based REST authentication

I get an invalid arguments message.  
If I use Basic Authentication alone it works fine 


Here is my controller:

auth.settings.allow_basic_login = True

# THIS ONE DOES NOT WORKS
@auth.requires(somethingIKnowIsTrue==True, requires_login=False)
@request.restful()
def thisOneDoesNOTWork():
def GET():   
return dict(yo=you got it)
return locals()

# THIS ONE WORKS
@auth.requires_login()
@request.restful()
def thisOneWorks():
def GET():   
return dict(yo=you got it)
return locals()

-- 

--- 
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] Redirected https is returning HTML instead of JSON. Direct call works fine.

2012-06-28 Thread Larry Weinberg
I have a function that returns JSON data.
It works great when called directly over https (using curl or pycurl).

If however I have a redirect somewhere that sends me to my web2py function 
it  returns html instead which requests a redirect from the caller.
I would like it to continue to deliver the JSON.  Is that possible or not 
allowed ?

It delivers something like this:
!-DOCTYPE HTML SECURITY (Redirector) -
HTML
HEAD
TITLEMy Title/TITLE
meta http-equiv=Pragma content=no-cache
meta http-equiv=expires content=Thu, 29 Nov 2007 16:18:42 GMT
META HTTP-EQUIV=REFRESH CONTENT=0; 
URL=https://mysite/myapp/mycontroller/statecheck?state=84b148ce-8960-4393-a5a2-f6e92d6ff169;




[web2py] Re: Redirected https is returning HTML instead of JSON. Direct call works fine.

2012-06-28 Thread Larry Weinberg
Sorry.  Once again this had nothing to do with web2py.  I'll try and be 
more thorough next time I post.
It was the method of redirect that my redirect server was using that was 
causing the problem. urllib2 and pycurl both failed to handle meta redirect 
which is supposedly not preferred method these days.   When I switched it 
to use a simple location redirect  everything works great.


[web2py] Re: Suggestion to add more mod_wsgi info to help new users -- WSGIPassAuthorization for instance

2012-06-28 Thread Larry Weinberg
Great!  Thanks Massimo.  I'm sure that will save some others some time!

[web2py] Re: Reopening: problems running from subfolder with mod_wsgi

2012-06-27 Thread Larry Weinberg
Here is a summary of what I have found.
1 -- My inconsistent problems look like they were due to trying to run two 
different versions of web2py inside one WSGIProcessGroup or mod_wsgi.  This 
was probably a very bad idea on my part.  Needs to be done in separate 
virtual hosts with separate WSGIProcessGroups.  Fixing that fixed a number 
of my weird issues.

2 - It does look like web2py's  rewrite.py has a hardcoded href to /admin 
for the ticket html itself.  So this does look like a small problem in 
web2py trunk when trying to run it using urls underneath a subfolder.  Most 
else seems to works fine so far.



On Monday, June 25, 2012 5:40:08 PM UTC-7, Larry Weinberg wrote:

 This error is always repeatable:

 The Internal error page always links incorrectly to the ticket.

 It links back to the top site.

 admin/default/ticket/up/10.102.67.127.2012-06-25.17-37-36.38cfaa82-a858-4e7b-9a69-9afc0fb3e7e7

 If I visit the errors link normally I can see the error.



-- 





[web2py] Suggestion to add more mod_wsgi info to help new users -- WSGIPassAuthorization for instance

2012-06-27 Thread Larry Weinberg
I'm a newbie to apache configuration, so I just spent hours trying to 
determine why none of the REST-api-with-authentication web2py examples 
were working for me. All worked fine without authentication.

It turns out the apache server with mod_wsgi strips the authorization out 
by default.
A one line sentence about this in the web2py manual would have left me with 
more hair!

Thanks for listening.


[web2py] Re: Suggestion to add more mod_wsgi info to help new users -- WSGIPassAuthorization for instance

2012-06-27 Thread Larry Weinberg
In order to have the web2py examples work out of the box on Apache with 
mod_wsgi, an extra directive is needed in the Apache configuration for the 
VirtualHost

WSGIPassAuthorization On

This allows basic authentication to proceed through. 

It looks like there are some good reasons why mod_wsgi in apache strips 
authorization by default:
The link to the info is: 
http://code.google.com/p/modwsgi/wiki/ConfigurationDirectives#WSGIPassAuthorization





[web2py] Reopening: problems running from subfolder with mod_wsgi

2012-06-25 Thread Larry Weinberg
I am again running into occasional problems trying to run the trunk code 
from a subfolder instead of from a root folder under apache and mod_wsgi.

Maybe my problem is compounded because I also have another web2py installed 
at the root, but it seems that some of the internal web2py
functions are not working properly and are sometimes not obeying the route 
specifications.

I have a subdomain set up which has web2py 1.99 installed at the root of 
the domain.
   WSGIScriptAlias /  /opt/web-apps/web2py/wsgihandler.py
   WSGIScriptAlias /trunk /opt/web-apps/w2p_trunk/web2py/wsgihandler.py

I now have my routes.py file like this:

routes_in=(('/trunk/(?Pany.*)','/\gany'),)
routes_out=(('/(?Pany.*)','/trunk/\gany'),)

In general, most things seem to work.  The problems I am having:
1) Sometimes -- not always -- the links to tickets will link to the top 
level web2py install instead of the site under trunk
2) I cannot use or edit (without error) any python modules added to an 
application's modules folder. 
Failed to reload module:  because no module named xxx.modules.test

If I load the site using the internal rocket server there are no problems.



-- 





[web2py] Re: Reopening: problems running from subfolder with mod_wsgi

2012-06-25 Thread Larry Weinberg
More info:

I restart apache.  
Log in to admin in the subfolder version.  
Everything works properly.

Log in to admin in the top level version.   
Visit the admin of the lower level version. 
Sometimes errors occur.  Sometimes not.
Sometimes it makes me log in again sometimes not.
It appears that there is some kind of confusion between the sessions.


-- 





[web2py] Re: Reopening: problems running from subfolder with mod_wsgi

2012-06-25 Thread Larry Weinberg
This error is always repeatable:

The Internal error page always links incorrectly to the ticket.

It links back to the top site.
admin/default/ticket/up/10.102.67.127.2012-06-25.17-37-36.38cfaa82-a858-4e7b-9a69-9afc0fb3e7e7

If I visit the errors link normally I can see the error.

-- 





[web2py] Trunk trouble with routed subfolder

2012-06-24 Thread Larry Weinberg
I am working on a centos 5.5 server using apache and mod_wsgi.
I have a subdomain set up which has web2py 1.99 installed at the root of 
the domain.
This works great.

I have been trying to set up a subfolder to host the trunk version of 
web2py independently so I can try it.
I added to the apache WSGI configuration to add the /trunk/ version of 
web2py which is in 
a subfolder of the web-apps folder:
   WSGIScriptAlias /trunk /opt/web-apps/w2p_trunk/web2py/wsgihandler.py

This wouldn't work with just changes to the apache configuration.
I had to edit the routes.py file like this and restart apache/web2py before 
this would work:

routes_in=(('/trunk/(?Pany.*)','/\gany'),)
routes_out=(('/(?Pany.*)','/trunk/\gany'),)

So now I am able to load both sites independently:
mydomain/admin
and 
mydomain/trunk/admin 
are two different installs of web2py.

(I don't like that I had to change the routes file to make this work but I 
can deal with that if that's how it works)

Now I've tried to export a simple test app from my main server and load it 
into the trunk web2py admin interface.
It eventually fails somewhere as it's confused between the two web2py 
installations.
If I just create a new simple app in the new subfolder version ( trunk ) it 
works fine.
But installing a packaged app doesn't work -- even a newly created simple 
app.

It looks like something in installing an application is broken if there is 
a route like this set up.
Is this possible or am I doing something wrong?

Thanks for any info

Larry

-- 





[web2py] Re: Trunk trouble with routed subfolder

2012-06-24 Thread Larry Weinberg
some more info:
If I try to pack up a newly created app on the subfolder version, it fails 
with a ticket.
Internal errorTicket issued: 
unknownhttps://pgdev.smithmicro.com/admin/default/ticket/unknown
If I click on the ticket link, it's linked to unknown in the main web2py 
install instead of the subfolder
 

-- 





[web2py] Re: Trunk trouble with routed subfolder

2012-06-24 Thread Larry Weinberg
Um, I may have solved my own problem.

In the https (443) section of the apache conf file I had a mistake:
I had
AliasMatch ^/trunk([^/]+)/static/(.*) 
/opt/web-apps/w2p_trunk/web2py/applications/$1/static/$2

instead of 

AliasMatch ^/trunk/([^/]+)/static/(.*) 
/opt/web-apps/w2p_trunk/web2py/applications/$1/static/$2

I'm not sure if that's what fixed it but it seems to be working now.

-- 





[web2py] Editor broken in trunk?

2012-05-20 Thread Larry Weinberg
My previous web2py installation works fine

I grabbed the trunk and out of the box the editor is unable to save.  I can 
edit text, but there is no way to save the text now.  Also, the menu bar is 
not visible for it.

Is this a known problem or do I have some python installation problem?




[web2py] Re: Editor broken in trunk?

2012-05-20 Thread Larry Weinberg
I cannot save with the button.
I tried Safari and Chrome.  Both had the problem.

On Sunday, May 20, 2012 8:46:42 AM UTC-7, Larry Weinberg wrote:

 My previous web2py installation works fine

 I grabbed the trunk and out of the box the editor is unable to save.  I 
 can edit text, but there is no way to save the text now.  Also, the menu 
 bar is not visible for it.

 Is this a known problem or do I have some python installation problem?




[web2py] Re: how to set text limitation in a div

2012-05-15 Thread Larry Weinberg
You want style of overflow:hidden I believe.



[web2py] Why does jquery autocomplete not work in subview form after submission?

2012-05-14 Thread Larry Weinberg
I'm not sure if this is web2py question or javascript related issue.

In an HTML view I am trying to call a subview with a form in it that has a 
jquery
autocomplete attached to a text field in the form.  
I attach the autocomplete like this in the form view's document ready 
function:

$(document).ready(function(){ 
$('#autome').autocomplete({
source: function(request, response) {
$.ajax({  url: /myapp/mycontroller/myautocomplete.json,
data: request,
dataType: json,
type: POST,
success: function(data){ response(data.source)}  
})}});
});

It works fine the first time the form is loaded as a subview via LOAD. 
Once the form is processed through self-submission the autocomplete no 
longer works even though 
the ready function is being called again.

I'm loading the view like this:

div style=position:absolute;top: -8px;width:956px;min-width:956px;
{{=LOAD('default/ajaxsearch',ajax=True)}}
/div


If I run the form by itself (not in a LOAD) the autocomplete works before 
and after form submission as expected.

Here is the function for the inner form:

def innerform():
items=[]

form=FORM(DIV(TABLE(TR(INPUT(_name='q',_id=autome,requires=IS_NOT_EMPTY(),_keepvalues=False),
   INPUT(_type='submit',_value='Search')
  ))),_method='GET')
if form.accepts(request.vars,session=None):
items = doMyStuff() 
return dict(form=form,items=items)

Can anyone tell me why?

Thanks




[web2py] Re: Why does jquery autocomplete not work in subview form after submission?

2012-05-14 Thread Larry Weinberg
I found a solution to this. I had to add a jQuery .on() handler for focus. 
Is this the best way to handle this?
I guess this isn't a web2py problem, it's the nature of 
ajax/javascript/jquery I assume.  Any way for web2py to magically fix this 
kind of thing?

$(document).ready(function()
{ 
$(document).on(focus,'#autome',function(e) {
if ( !$(this).data(autocomplete) ) { // If the autocomplete 
wasn't called yet:
   $('#autome').autocomplete({
 source: function(request, response) {
$.ajax({  url: 
/autocomplete/default/myautocomplete.json,
  data: request,
  dataType: json,
  type: POST,
  success: 
function(data){ response(data.source)}  
  })}});
}
});
  
$('#autome').autocomplete({
 source: function(request, response) {
$.ajax({  url: 
/autocomplete/default/myautocomplete.json,
  data: request,
  dataType: json,
  type: POST,
  success: function(data){ 
response(data.source)}  
  })}});

});

On Monday, May 14, 2012 3:19:05 PM UTC-7, Larry Weinberg wrote:

 OK, here is a minimal sample app that demonstrates the problem.  I'm 
 pretty new to web2py so maybe I'm not using the system as I should be. 
  Thank you for taking a look!



[web2py] Re: Admin interface slow when static dir has a lot of files

2012-05-06 Thread Larry Weinberg
Is this being addressed?  I am finding the same problem.  Other than that, 
and a couple of other suggestions for having more links to speed up the 
admin interface workflow I am loving web2py!

[web2py] Admin Interface suggestions

2012-05-06 Thread Larry Weinberg
Once again I am LOVING web2py.  It's transformational technology.

I do have some admin interface suggestions:

1 - It would be very nice if all views in the admin interface included a 
single horizontal line near the top that had links back to the last 4 or 5 
edited files to make it easier to bounce back and forth.

2 - The collapsed state of the groupings should be remembered.  I rarely 
(never) need to see the language files, for example, and they are above the 
javascript and css files.

3 - The most often edited groups should be at the top (even though the db 
group is conceptually first.  Maybe the DB group should be collapsed if it 
needs to be first for new users.
I typically edit the views and style sheets most often, followed by the 
controllers.

4 - When editing a view it would be great if there was a popup to the list 
of style sheets and javascript files being included by the view.

5 -  Something to think about:  the admin interface could display in two 
columns optionally.  That would make many of the files visible without 
scrolling

6 - The default text editing area for a file could be larger.  Maybe there 
should be an alternate view of it that removes the large hotkey display.

More to come