On Feb 12, 2011, at 10:10 AM, G. Clifford Williams wrote:
>
> 1) can you paste your app.yaml/
application: jkl-web2py-welcome
version: 5
api_version: 1
runtime: python
derived_file_type:
- python_precompiled
handlers:
- url: /_ah/stats.*
script: $PYTHON_LIB/google/appengine/ext/appstats/ui.py
login: admin
- url: /(?P<a>.+?)/static/(?P<b>.+)
static_files: applications/\1/static/\2
upload: applications/(.+?)/static/(.+)
secure: optional
expiration: "90d"
- url: /_ah/admin/.*
script: $PYTHON_LIB/google/appengine/ext/admin
login: admin
- url: /_ah/queue/default
script: gaehandler.py
login: admin
- url: .*
script: gaehandler.py
secure: optional
admin_console:
pages:
- name: Appstats
url: /_ah/stats
skip_files: |
^(.*/)?(
(app\.yaml)|
(app\.yml)|
(index\.yaml)|
(index\.yml)|
(#.*#)|
(.*~)|
(.*\.py[co])|
(.*/RCS/.*)|
(\..*)|
((admin|examples|welcome)\.(w2p|tar))|
(applications/.*?/(cron|databases|errors|cache|sessions)/.*)|
((logs|scripts)/.*)|
(anyserver\.py)|
(web2py\.py)|
((cgi|fcgi|modpython|wsgi)handler\.py)|
(epydoc\.(conf|css))|
(httpserver\.log)|
(logging\.example\.conf)|
(routes\.example\.py)|
(setup_(app|exe)\.py)|
(splashlogo\.gif)|
(parameters_\d+\.py)|
(options_std.py)|
(gluon/tests/.*)|
(gluon/rocket\.py)|
(gluon/winservice\.py)|
(.*\.(bak|orig))|
)$
builtins:
- remote_api: on
- datastore_admin: on
>
> 2) you should have some code like this in your main model file:
> if request.env.web2py_runtime_gae: # if running on Google App
> Engine
> db = DAL('gae') # connect to Google BigTable
> session.connect(request, response, db=db) # and store sessions and
> tickets th
> else: # else use a normal
> relational database
> db = DAL('sqlite://gripez.db')
For now, it's just the stock welcome app, so it has that logic.
And it works OK when deployed to GAE; it's just running it locally that breaks.
> 3) you probably want to link 'applications/your_app_name' to 'init' or use
> one of the other remedies for having your app be the default. More info here:
> http://web2py.com/book/default/chapter/04#Application-init
Being welcome, it's the default in the absence of an app named init.
>
> On Sat, Feb 12, 2011 at 09:43:08AM -0800, Jonathan Lundell spake:
>> On Feb 12, 2011, at 9:29 AM, G. Clifford Williams wrote:
>>>
>>> On Sat, Feb 12, 2011 at 09:20:02AM -0800, Jonathan Lundell spake:
>>>> Is there a trick to getting web2py to run locally with the GAE Launcher?
>>>> (OS X FWIW)
>>>>
>>>> I'm playing with the stock stable release. It works fine when deployed,
>>>> but not locally (immediate ticket, and I don't know how to find the
>>>> ticket).
>>>
>>> web2py tickets are generated as datastore objects. You won't be able to
>>> search the datastore for objects until it's been seeded (which just means
>>> that something has to be there before you can search for it). To view the
>>> tickets go to: http://localhost:[port]/_ah/admin/datastore
>>>
>>> there you will see a dropdown list for "Entity Kind" select the one labeled
>>> web2py_ticket_[appname] then click 'list entries'. These are your tickets
>>>
>>>
>>> I hope that helps
>>
>> Also, I see that the Launcher's SDK Console toolbar button takes me there; I
>> just didn't know what I was looking for.
>>
>> FWIW, I'm seeing this:
>>
>> S'Traceback (most recent call last):\n
>> File "/Users/jlundell/Projects/GAE/welcome/gluon/restricted.py", line 188,
>> in restricted\n exec ccode in environment\n
>> File
>> "/Users/jlundell/Projects/GAE/welcome/applications/admin/controllers/default.py:ticket",
>> line 1159, in <module>\n
>> File "/Users/jlundell/Projects/GAE/welcome/gluon/globals.py", line 95, in
>> <lambda>\n self._caller = lambda f: f()\n
>> File
>> "/Users/jlundell/Projects/GAE/welcome/applications/admin/controllers/default.py:ticket",
>> line 1124, in ticket\n
>> File "/Users/jlundell/Projects/GAE/welcome/gluon/restricted.py", line 162,
>> in load\n self.layer = d[\'layer\']\nTypeError: \'NoneType\' object is
>> unsubscriptable\n'
>>
>> ...which looks like an error loading a ticket, unfortunately.