Hi! I'm actually trying to do a simple web app using Python 2.7 and pyramid (v 1.3) however I'm stuck in the process of running a demo locally because the documentation from the Pyramid website stops after the installation of the Pyramid framework in the virtual environment, using this tutorial here: http://docs.pylonsproject.org/projects/pyramid/en/1.3-branch/narr/ins...
So I'm new to this world and I'm kind of lost. I've already read and followed Pyramid tutorials and the same for the App Engine but still no success on running locally the web app with Pyramid framework.
I would appreciate some lights on doing this! My development environment is Windows 7 with Python 2.7 (and setuptool) installed.
Many thanks and sorry about my English. It's the first time that I've been searching for help somewhere out of books or documentation.
> Hi! I'm actually trying to do a simple web app using Python 2.7 and > pyramid (v 1.3) however I'm stuck in the process of running a demo locally > because the documentation from the Pyramid website stops after the > installation of the Pyramid framework in the virtual environment, using > this tutorial here: > http://docs.pylonsproject.org/projects/pyramid/en/1.3-branch/narr/ins...
> So I'm new to this world and I'm kind of lost. I've already read and > followed Pyramid tutorials and the same for the App Engine but still no > success on running locally the web app with Pyramid framework.
> I would appreciate some lights on doing this! My development environment > is Windows 7 with Python 2.7 (and setuptool) installed.
> Many thanks and sorry about my English. It's the first time that I've been > searching for help somewhere out of books or documentation.
> To post to this group, send email to pylons-discuss@googlegroups.com. > To unsubscribe from this group, send email to > pylons-discuss+unsubscribe@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/pylons-discuss?hl=en.
On Wed, 2012-03-14 at 14:04 -0400, Thomas G. Willis wrote: > Hello, one of the tasks that was outlined as part of the sprints after > pycon was improving the documentation for running pyramid on > appengine.
> if you want to give that a spin, just file an issue in github if you > have any issues.
It's working for me. My notes:
Pyramid-1.3 works just fine with webob-1.1.1. Pyramid tests all work, and the buildout takes care of putting the gae-supported webob in the development appserver, so you should get a heads-up through testing if there are any edge cases in your app. You will end up with an extra webob egg in the eggs folder, but that doesn't matter because the stuff in parts/MyApp is what goes to appengine.
Anytime you add a required dependency in your app's setup.py, also add that dependency (and sub-dependencies, if any) to the rod.recipe.appengine stanza in buildout.cfg. Then re-run bin/buildout. Note that apps can be spelled differently in the two places. E.g., it's "pyramid_rpc" in requires, and "pyramid-rpc" in the appengine stanza.
You want pyramid installed in your system python. Don't bother with a virtualenv when using this buildout; the paths get duplicative and confusing. Installing pyramid in your system python makes
> pcreate -t appengine_starter MyApp
or
> paster create -t appengine_starter MyApp
available to you when you want it.
You do not want zc.buildout installed system-wide. If you get "can't find it" errors, that is the most likely problem. When you do "python bootstrap.py", don't forget the --distribute. e.g.,
python bootstrap.py --distribute
To run the devappserver, point it to parts/MyApp, not src/MyApp.
> bin/devappserver parts/MyApp
Point "bin/appcfg update" to the same location.
Make sure you run bin/buildout before running, testing or updating your app! parts/MyApp is updated from src/MyApp by buildout.
Thanks for the feedback. I was pleasantly surprised you got it working on pyramid 1.3. I'll have to cut another release to pypi I suppose. :)
Depending on when you pulled you may have noticed that unit tests are run through py.test and it takes care of bootstrapping the appengine services for your tests and keeps the index.yaml updated for you(see conftest.py). I am pretty happy with how that turned out because when I was doing my first appengine app, the challenge was writing/running tests under the devappserver environment.
On Wednesday, March 21, 2012 4:59:00 PM UTC-4, Jim Washington wrote:
> On Wed, 2012-03-14 at 14:04 -0400, Thomas G. Willis wrote: > > Hello, one of the tasks that was outlined as part of the sprints after > > pycon was improving the documentation for running pyramid on > > appengine.
> > if you want to give that a spin, just file an issue in github if you > > have any issues.
> It's working for me. My notes:
> Pyramid-1.3 works just fine with webob-1.1.1. Pyramid tests all work, > and the buildout takes care of putting the gae-supported webob in the > development appserver, so you should get a heads-up through testing if > there are any edge cases in your app. You will end up with an extra > webob egg in the eggs folder, but that doesn't matter because the stuff > in parts/MyApp is what goes to appengine.
> Anytime you add a required dependency in your app's setup.py, also add > that dependency (and sub-dependencies, if any) to the > rod.recipe.appengine stanza in buildout.cfg. Then re-run bin/buildout. > Note that apps can be spelled differently in the two places. E.g., it's > "pyramid_rpc" in requires, and "pyramid-rpc" in the appengine stanza.
> You want pyramid installed in your system python. Don't bother with a > virtualenv when using this buildout; the paths get duplicative and > confusing. Installing pyramid in your system python makes
> > pcreate -t appengine_starter MyApp
> or
> > paster create -t appengine_starter MyApp
> available to you when you want it.
> You do not want zc.buildout installed system-wide. If you get "can't > find it" errors, that is the most likely problem. When you do "python > bootstrap.py", don't forget the --distribute. e.g.,
> python bootstrap.py --distribute
> To run the devappserver, point it to parts/MyApp, not src/MyApp.
> > bin/devappserver parts/MyApp
> Point "bin/appcfg update" to the same location.
> Make sure you run bin/buildout before running, testing or updating your > app! parts/MyApp is updated from src/MyApp by buildout.
On Thursday, March 22, 2012 6:22:11 AM UTC-4, Thomas G. Willis wrote:
> Hey Jim,
> Thanks for the feedback. I was pleasantly surprised you got it working on > pyramid 1.3. I'll have to cut another release to pypi I suppose. :)
> Depending on when you pulled you may have noticed that unit tests are run > through py.test and it takes care of bootstrapping the appengine services > for your tests and keeps the index.yaml updated for you(see conftest.py). I > am pretty happy with how that turned out because when I was doing my first > appengine app, the challenge was writing/running tests under the > devappserver environment.
> Thanks again.
> now to finish the cookbook recipe.
> On Wednesday, March 21, 2012 4:59:00 PM UTC-4, Jim Washington wrote:
>> On Wed, 2012-03-14 at 14:04 -0400, Thomas G. Willis wrote: >> > Hello, one of the tasks that was outlined as part of the sprints after >> > pycon was improving the documentation for running pyramid on >> > appengine.
>> > if you want to give that a spin, just file an issue in github if you >> > have any issues.
>> It's working for me. My notes:
>> Pyramid-1.3 works just fine with webob-1.1.1. Pyramid tests all work, >> and the buildout takes care of putting the gae-supported webob in the >> development appserver, so you should get a heads-up through testing if >> there are any edge cases in your app. You will end up with an extra >> webob egg in the eggs folder, but that doesn't matter because the stuff >> in parts/MyApp is what goes to appengine.
>> Anytime you add a required dependency in your app's setup.py, also add >> that dependency (and sub-dependencies, if any) to the >> rod.recipe.appengine stanza in buildout.cfg. Then re-run bin/buildout. >> Note that apps can be spelled differently in the two places. E.g., it's >> "pyramid_rpc" in requires, and "pyramid-rpc" in the appengine stanza.
>> You want pyramid installed in your system python. Don't bother with a >> virtualenv when using this buildout; the paths get duplicative and >> confusing. Installing pyramid in your system python makes
>> > pcreate -t appengine_starter MyApp
>> or
>> > paster create -t appengine_starter MyApp
>> available to you when you want it.
>> You do not want zc.buildout installed system-wide. If you get "can't >> find it" errors, that is the most likely problem. When you do "python >> bootstrap.py", don't forget the --distribute. e.g.,
>> python bootstrap.py --distribute
>> To run the devappserver, point it to parts/MyApp, not src/MyApp.
>> > bin/devappserver parts/MyApp
>> Point "bin/appcfg update" to the same location.
>> Make sure you run bin/buildout before running, testing or updating your >> app! parts/MyApp is updated from src/MyApp by buildout.
On Thursday, March 22, 2012 7:24:52 AM UTC-4, Jim Washington wrote:
> On Thu, 2012-03-22 at 04:05 -0700, Thomas G. Willis wrote: > > Hi Jim, I just tried it with pyramid 1.3 and I didn't get the same > > results you did.
FYI, Pyjamas http://pyjs.org is a python-language front-end application package. It allows you to think of your web app as a python desktop application, rather than as a bunch of web pages. It currently can do desktop applications (with a forked webkit-gtk or MSHTML) and web applications (python translated to javascript) using the same code. It makes fat clients, like GWT, which pyjamas began as a python version of. Pyjamas works very nicely with a pyramid backend through pyramid_rpc's JSON-RPC implementation.
So, if you want to experiment with Pyramid+Pyjamas+GAE, it's never been easier.
It includes sample code, so you quickly will get something that looks like http://test-app-509.appspot.com/ on your local port 8080, ready for upload/update to GoogleAppEngine.
Read the directions. git clone it. "python setup.py" it. Try it out.
> FYI, Pyjamas http://pyjs.org is a python-language front-end application > package. It allows you to think of your web app as a python desktop > application, rather than as a bunch of web pages. It currently can do > desktop applications (with a forked webkit-gtk or MSHTML) and web > applications (python translated to javascript) using the same code. It > makes fat clients, like GWT, which pyjamas began as a python version of. > Pyjamas works very nicely with a pyramid backend through pyramid_rpc's > JSON-RPC implementation.
> So, if you want to experiment with Pyramid+Pyjamas+GAE, it's never been > easier.
> It includes sample code, so you quickly will get something > that looks like http://test-app-509.appspot.com/ on your local port > 8080, ready for upload/update to GoogleAppEngine.
> Read the directions. git clone it. "python setup.py" it. Try it out.
> Feedback welcome.
> - Jim Washington
> -- > You received this message because you are subscribed to the Google Groups > "pylons-discuss" group. > To post to this group, send email to pylons-discuss@googlegroups.com. > To unsubscribe from this group, send email to > pylons-discuss+unsubscribe@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/pylons-discuss?hl=en.
I am trying to run Pyramid 1.3 app on app engine python27 after cookbook recipe Pyramid on Google’s App Engine (using buildout)<http://docs.pylonsproject.org/projects/pyramid_cookbook/en/latest/dep...>. All work fine when I return Response object directly, but when i am using renderer option with chameleon template or render_to_responce, I get error
Traceback (most recent call last):
File "/home/user/workspace/qlugat/parts/google_appengine/google/appengine/runtim e/wsgi.py", line 195, in Handle
result = handler(dict(self._environ), self._StartResponse)
File "/home/user/workspace/qlugat/parts/qlugat/pyramid/router.py", line 187, in __call__
response = self.handle_request(request)
File "/home/user/workspace/qlugat/parts/qlugat/pyramid/tweens.py", line 20, in excview_tween
response = handler(request)
File "/home/user/workspace/qlugat/parts/qlugat/pyramid/router.py", line 164, in handle_request
response = view_callable(context, request)
File "/home/user/workspace/qlugat/parts/qlugat/pyramid/config/views.py", line 352, in rendered_view
context)
File "/home/user/workspace/qlugat/parts/qlugat/pyramid/renderers.py", line 396, in render_view
return self.render_to_response(response, system, request=request)
File "/home/user/workspace/qlugat/parts/qlugat/pyramid/renderers.py", line 426, in render_to_response
result = self.render(value, system_values, request=request)
File "/home/user/workspace/qlugat/parts/qlugat/pyramid/renderers.py", line 399, in render
renderer = self.renderer
File "/home/user/workspace/qlugat/parts/qlugat/pyramid/decorator.py", line 17, in __get__
val = self.wrapped(inst)
File "/home/user/workspace/qlugat/parts/qlugat/pyramid/renderers.py", line 383, in renderer
return factory(self)
File "/home/user/workspace/qlugat/parts/qlugat/pyramid/chameleon_zpt.py", line 25, in renderer_factory
return renderers.template_renderer_factory(info, ZPTTemplateRenderer)
File "/home/user/workspace/qlugat/parts/qlugat/pyramid/renderers.py", line 351, in template_renderer_factory
return lookup(info)
File "/home/user/workspace/qlugat/parts/qlugat/pyramid/renderers.py", line 323, in __call__
if not pkg_resources.resource_exists(package_name, filename):
File "/home/user/workspace/qlugat/parts/qlugat/pkg_resources.py", line 897, in resource_exists
return get_provider(package_or_requirement).has_resource(resource_name)
File "/home/user/workspace/qlugat/parts/qlugat/pkg_resources.py", line 1196, in has_resource
return self._has(self._fn(self.module_path, resource_name))
File "/home/user/workspace/qlugat/parts/qlugat/pkg_resources.py", line 1250, in _has
"Can't perform this operation for unregistered loader type"
NotImplementedError: Can't perform this operation for unregistered loader type
looks like it's bombing out on some setup tools magic(probably some entry points stuff), which doesn't work on appengine. I don't know enough about Chameleon to know what the fix would be.
Also, unless you changed buildout.cfg to include it, chameleon won't be deployed with your app anyway.
On Monday, September 3, 2012 10:27:07 AM UTC-4, bismigalis wrote:
> I am trying to run Pyramid 1.3 app on app engine python27 after cookbook > recipe Pyramid on Google’s App Engine (using buildout)<http://docs.pylonsproject.org/projects/pyramid_cookbook/en/latest/dep...>. All > work fine when I return Response object directly, but when i am using > renderer option with chameleon template or render_to_responce, I get error
> Traceback (most recent call last):
> File > "/home/user/workspace/qlugat/parts/google_appengine/google/appengine/runtim e/wsgi.py", > line 195, in Handle
> result = handler(dict(self._environ), self._StartResponse)
> File "/home/user/workspace/qlugat/parts/qlugat/pyramid/router.py", line > 187, in __call__
> response = self.handle_request(request)
> File "/home/user/workspace/qlugat/parts/qlugat/pyramid/tweens.py", line > 20, in excview_tween
> response = handler(request)
> File "/home/user/workspace/qlugat/parts/qlugat/pyramid/router.py", line > 164, in handle_request
> response = view_callable(context, request)
> File "/home/user/workspace/qlugat/parts/qlugat/pyramid/config/views.py", > line 352, in rendered_view
> context)
> File "/home/user/workspace/qlugat/parts/qlugat/pyramid/renderers.py", > line 396, in render_view
> return self.render_to_response(response, system, request=request)
> File "/home/user/workspace/qlugat/parts/qlugat/pyramid/renderers.py", > line 426, in render_to_response
> result = self.render(value, system_values, request=request)
> File "/home/user/workspace/qlugat/parts/qlugat/pyramid/renderers.py", > line 399, in render
> renderer = self.renderer
> File "/home/user/workspace/qlugat/parts/qlugat/pyramid/decorator.py", > line 17, in __get__
> val = self.wrapped(inst)
> File "/home/user/workspace/qlugat/parts/qlugat/pyramid/renderers.py", > line 383, in renderer
> return factory(self)
> File > "/home/user/workspace/qlugat/parts/qlugat/pyramid/chameleon_zpt.py", line > 25, in renderer_factory
> return renderers.template_renderer_factory(info, ZPTTemplateRenderer)
> File "/home/user/workspace/qlugat/parts/qlugat/pyramid/renderers.py", > line 351, in template_renderer_factory
> return lookup(info)
> File "/home/user/workspace/qlugat/parts/qlugat/pyramid/renderers.py", > line 323, in __call__
> if not pkg_resources.resource_exists(package_name, filename):
> File "/home/user/workspace/qlugat/parts/qlugat/pkg_resources.py", line > 897, in resource_exists
> return get_provider(package_or_requirement).has_resource(resource_name)
> File "/home/user/workspace/qlugat/parts/qlugat/pkg_resources.py", line > 1196, in has_resource
> return self._has(self._fn(self.module_path, resource_name))
> File "/home/user/workspace/qlugat/parts/qlugat/pkg_resources.py", line > 1250, in _has
> "Can't perform this operation for unregistered loader type"
> NotImplementedError: Can't perform this operation for unregistered loader > type