Hi,

I would like to share with you my small framework I build for the
Google App Engine and think you might like it. You find it here coming
along with a short screen cast explaining basic usage:

http://code.google.com/p/pyxer/ (Project)
http://pypi.python.org/pypi/pyxer (Download)

To get started you need to have SetupTools (easy_install) installed on
your system. So installing Pyxer is like this:

$ easy_install pyxer

Now to set up a new project go into an empty directory and type:

$ pyxer init

You get everything there you need, including an 'app.yaml' file that
you might modify a bit, but you don't have to to get started. All
Python packages go into the sub directory 'site-packages'. To install
new packages just drop them there or use pyxer as an easy_install
replacement like:

$ pyxer install pygments

Now it's time to start the server like you always do, e.g.:

$ dev_appserver.py .

For coding have a look into the 'public' folder. If you have static
content, just drop it there and it will be served. For controllers
make the folder an Python package by adding the '__init__.py  file. A
simple example could then look like this:

from pyxer.base import *

@expose
def index(q='nothing'):
    return 'The GET variable q contains: %s' % q

If you now call 'http://localhost:8080/?q=Hello' you get the output
'The GET variable q contains: Hello'.

If you return lists or dictionaries, the output will be send in JSON
format. If you do not return or return 'None' Pyxer is looking for a
template with the same name as the controller plus a '.html' suffix,
e.g.

@expose
def test():
    c.message = 'Hello World'

This will look for the file 'test.html' in the same directory. This is
handled as a template which supports a templating language that is
very close to Genshi, but less restrictive. So this could be our
template 'test.html':

<html>
  <head>
  <title py:content='c.message'></title>
  </head>
  <body>
    This is a message: $c.message
  </body>
</html>

'c' is a pseudo global variable that is used as the 'context' for
passing values to the template. There are more of these e.g. for
session handling or request data. See the documentation for more
details.

Hope you enjoy this Open Source technology.

Dirk



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to