anyone using nagare framework on google app engine ?
it seems interesting, but i could not find any documentaiton on how to use it on
google app engine, as it uses stackless python.
so any chances of its running on google app engine ?
also, how stack less python differ from normal python ?
thanks.
links :
Nagare Framework
Stackless python
I currently have a not-yet-released, prototype version of Nagare for GAE (you can see the canonical Counter example at http://nagareproject.appspot.com/)
Here are the 3 Nagare components not working on GAE, with their workarounds in this prototype:
Stackless Python:
Problem: GAE is only pure vanilla CPython
Solution: well, use only pure Python
Limitation: in Nagare, Stackless Python is used to obtain continuation objects. Without Stackless, we lose the call()/answer() feature of Nagare. But note that call()/on_answer() is still working.
Lxml:
Problem: C module not accepted on GAE
Solution: HTML generation rewrote using only ElementTree
Limitation: no more advance Lxml features like XSL or complex XPATH expressions
PEAK-Rules:
Problem: standard AST tree management removed on GAE
Solution: rules management for HTML/JS generation rewrote
Limitation: the security and URL dispatch rules must be written by the developer without the help of generic methods
So, this version of Nagare is pretty much working fine on GAE. And I dare to say that, even with these limitations, Nagare still stay on GAE a better programming environement than the others Python frameworks.
If you want to test it, send a message in the Nagare users group or send me a personal mail to alain.poirier at net-ng.com
If it has a hard dependency on Stackless, it won't run on AppEngine. AE has its own Python runtime. If it doesn't leverage any of Stackless's non-standard extensions to Python, it might work, but I'd say that your chances aren't very good that it would just work.
Related
Any pointers, advice on implementing a REST API on App Engine with Python? Using webapp for the application itself.
What I currently know is that I can:
hack up my own webapp handlers for handling REST-like URIs, but this seems to lose its elegance for larger amounts of resources. I mean, it's simple when it comes to temperature/atlanta, but not so much* for even a rather simple /users/alice/address/work (though do keep in mind that I'm not saying this after having implemented that, just after spending some time trying to design an appropriate handler, so my perception may be off).
use the REST functionality provided by one of the bigger Python web frameworks out there. I have some unexplainable sympathy towards web2py, but, since it's not used for the project, bundling it with the application just to provide some REST functionality seems.. overkill?
(Huh, looks like I don't like any of these approaches. Tough.)
So here's me asking: what advice, preferably based on experience, would you have for me here? What are my options, is my view of them correct, did I miss something?
Thanks in advance.
I had a similar issue. Wanting to quickly get my DataStore exposed via REST to WebApps.
Found: AppEngine REST Server.
I have only used it lightly so far, but it certainly appears to be very useful with a small amount of work. And it does use webapp as you suggested.
ProtoRPC is bundled with the SDK, and it is robust and actively developed (however experimental). Although I think the source code itself is a little convoluted, the feature-set is pretty complete and it was made by someone with experience in creating this kind of library. It supports transmiting using JSON, ProtocolBuffer and URL-encoded formats.
Also, you can create APIs that work on the server side and client side -- it defines a 'message' protocol with implementations in Python and JavaScript. I used other "RESTful" Python libraries, but no other provided this consistency out of the box.
Here is the project page and here is the mailing list.
Edit: maybe their documentation is lacking some keywords, but just to be clear: one or the purposes of ProtoRPC is to provide a solid foundation to create REST services.
i'm working on on a project with DJango but i'm also thinking about going the Jython route. By doing so...since i'll be using the java instance instead of cpython wouldn't I be able to use java, scala, ruby and other other languages that run on top of the jvm if need be?
Scala works on GAE.
So does Ruby.
If you want to know about other JVM languages, google search for google app engine followed by the name of the language of interest.
Also see this page.
I'm not sure how good the Jython Java Interop is. But with Clojure you can generate Java classes pretty easy if it is nessesary (not sure). Clojure is really good for GAE.
There are nice librarys, blogs and applications. Like a DSL to work with the Datastore.
Librarys:
http://github.com/smartrevolution/clj-gae-datastore
http://github.com/r0man/appengine-clj
Look at this blog:
http://elhumidor.blogspot.com/2009/04/clojure-on-google-appengine.html
http://compojureongae.posterous.com/
http://www.hackers-with-attitude.com/
This is written in Clojure with the GAE:
http://the-deadline.appspot.com/
I'm looking to incorporate twitter API features into an app engine project that I'm working on.
I'm relatively new to both app engine and python, so I'm wondering what modules/frameworks I should use to most easily incorporate twitter, and to facilitate twitter oauth?
I've seen:
python-twitter
tipfy
gaema
I heartily recomment tipfy, but, as its author #moraes just said, it is its own, little, lightweight framework -- integration with others is possible (through WSGI middleware concepts), but your life is much simpler if you stick with a single framework, and django is much richer (and, of course, much bigger and less simple -- those are two sides of the same coin;-) and very very popular.
I personally like the "very lightweight" approach of tipfy (and WSGI, and Werkzeug, on which it relies), but if you have to pick one single framework for a wide variety of uses, you could surely do much worse than going with the most popular one, that is, django (e.g. as this post suggests).
python-twitter is the strongest library for a do-it-yourself approach. You implement the API in your framework of choice. It is well-maintained code.
tipfy ported the TwitterMixin from Tornado, so you don't need to care about many implementation details. It is probably easier to get something done but it is integrated to tipfy, so you can't really use it as a library for other frameworks. Auth example is here.
gaema is also ported from Tornado, but it is unmaintained.
Theres also tweetapp, but the repository says that it is also not maintained.
Other frameworks may have similar helpers (or you can use a OAuth library).
Disclaimer: I'm author of tipfy and gaema.
I recommend using: Tweepy. There is an example app here: http://github.com/wasauce/tweepy-examples
Tweepy is under active development so I think it will serve you well.
I'm really liking Python Twitter Tools but I haven't yet incorporated it into an App Engine app. Will be soon though. Tweepy is next on my list to checkout.
I'm really interested in learning Python for web development. Can anyone point me in the right direction? I've been looking at stuff on Google, but haven't really found anything that shows proper documentation and how to get started. Any recommended frameworks? Tutorials?
I've been doing PHP for 5 years now, so I just want to try something new.
Django is probably the best starting point. It's got great documentation and an easy tutorial (at http://djangoproject.com/) and a free online book too (http://www.djangobook.com/).
Web Server Gateway Interface
About
http://www.wsgi.org/en/latest/index.html
http://en.wikipedia.org/wiki/Web_Server_Gateway_Interface
Tutorials
http://webpython.codepoint.net/wsgi_tutorial
http://lucumr.pocoo.org/2007/5/21/getting-started-with-wsgi/
http://archimedeanco.com/wsgi-tutorial/
There are three major parts to python web frameworks, in my experience. From the front to back:
Views/Templates: Application frameworks don't function as independent scripts - instead, you map paths to python functions or objects which return html. To generate the html you probably need templates (aka views). Check out Cheetah.
Application framework/Server: There are plenty. CherryPy is my favorite, and is good for understanding how a python application server works because a) it's simple and b) unlike django and others, it is just the application server and doesn't include a templating engine or a database abstraction layer.
Database layer: I've actually never used it, but everyone seems to like SQLAlchemy. I prefer, in simple applications, executing SQL directly using a tool like psycopg2 (for postgres).
You can try Django. It's easy to learn, and it works with GAE (though the default version is 0.96, a little bit old, but you can change it). And there's a video about rapid development (by Guido Van Rossum) that goes through the basics of setting up a Django project in App Engine.
I am more interested in the design of the code (i.e functional design vs object oriented design). What are the best practices and what is the communities thoughts on this subject?
Not that it should matter, but I am working with Apache and Python technology stack.
If you are using Apache+Python, this sounds like you are using Python for dynamic web pages. In that case, I would strongly urge you to look into Django. There are also other Python web development environments, but Django is perhaps the most popular; and it has excellent documentation such as The Django Book. The Django Book describes best practices for setting up a robust web site: how to use multiple servers for redundancy, how to set up the database server, how to set up a cache to reduce the load on your database, etc.
Other than that tip, good Python server-side code would be just good Python code. There was a question asked recently about how to become a good Python developer, and I would suggest you read that: How do I get fluent in Python?