Kay runserver breaks with 1.6.0

47 views
Skip to first unread message

someone1

unread,
Nov 10, 2011, 12:14:19 PM11/10/11
to kay-users
I recently upgraded to the AppEngine SDK 1.6.0 and when I try to run
the server I get the following:

C:\...\src>c:\Python27\python.exe manage.py runserver
Running on Kay-1.1.1
WARNING 2011-11-10 12:10:18,825 rdbms_mysqldb.py:90] The rdbms API is
not available because the MySQLdb library could not be loaded.
Traceback (most recent call last):
File "manage.py", line 24, in <module>
script.run()
File "C:\...\src\kay\lib\werkzeug\script.py", line 121, in run
return func()
File "C:\...\src\kay\management\runserver.py", line 46, in
runserver_passthru_argv
p = get_datastore_paths()
File "C:\...\src\kay\misc\__init__.py", line 56, in
get_datastore_paths
get_appid())
File "C:\...\src\kay\misc\__init__.py", line 21, in get_appid
appconfig, unused = dev_appserver.LoadAppConfig(PROJECT_DIR, {})
ValueError: too many values to unpack

It worked prior to the upgrade so I'm not sure what's wrong.

Takashi Matsuo

unread,
Nov 10, 2011, 11:15:03 PM11/10/11
to kay-...@googlegroups.com

Sorry about that. I'll release a new version shortly, but for a time being, please re-write kay.misc.__init__.py as follows:

    appconfig, matcher, from_cache = dev_appserver.LoadAppConfig(PROJECT_DIR, {})

Thanks,

-- 
Takashi Matsuo
matsuo....@gmail.com
Kay's daddy


2011/11/11 someone1 <some...@gmail.com>

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


gmist

unread,
Nov 11, 2011, 4:14:55 AM11/11/11
to kay-users

Takashi Matsuo

unread,
Nov 12, 2011, 7:56:17 PM11/12/11
to kay-...@googlegroups.com

Thanks gmist!

I'm going to release a new version dedicated to python27 runtime.
For those who wants to use SDK-1.6.0 with python2.5 runtime, please use a patch from gmist.

I've just created a branch for py27 runtime at:

Currently, tests don't work properly and I'm looking into it. I want local unit tests to work properly at least.

Thanks,

-- 
Takashi Matsuo
matsuo....@gmail.com
Kay's daddy


Prateek Malhotra

unread,
Nov 16, 2011, 12:58:49 AM11/16/11
to kay-...@googlegroups.com
Hello Takashi,

Thanks for your continued support!

I tried your changes and can get the dev server to run properly now, however, I've noticed some issues:

- I downloaded your py27 branch and found that jinja2utils is still required by a preparser in the kay\management
- Since you removed jinja2 from kay\libs, it requires we have the jinja2 library installed in our python setup. Its not included with GAE SDK 1.6.0 or Python 2.7.2 (I'm using Windows 7)
- When launching from kay, loading a page complains about missing webapp2, I had to copy this to my c:\py27\Lib folder from the GAE directory in order to get it to work (launching directly from the appcfg shipped with 1.6.0 fixes that issue).

I think there are still some bugs that need to be worked out on the py27 branch or additional setup instructions included.

Anyway, I hope this helps. I've got my setup to work but it wasn't as simple as "plug'n'play"

If there's anything I can do to help, let me know. I really do enjoy using KAY :)

Thanks,
Prateek

Paolo Casciello

unread,
Nov 19, 2011, 10:43:36 AM11/19/11
to kay-...@googlegroups.com
hi Prateek, how did you resolved the jinja2utils in preparse? Did you just recovered the old module?

Paolo Casciello

unread,
Nov 19, 2011, 11:27:03 AM11/19/11
to kay-...@googlegroups.com
I respond to myself, just commented out the lines using it:

diff -r 3488f5cc85e2 kay/management/preparse.py
--- a/kay/management/preparse.py Sun Nov 13 23:06:40 2011 +0900
+++ b/kay/management/preparse.py Sat Nov 19 17:25:39 2011 +0100
@@ -18,7 +18,7 @@
 import kay
 import kay.app
 from kay.utils import local
-from kay.utils.jinja2utils.compiler import compile_dir
+#from kay.utils.jinja2utils.compiler import compile_dir
 from kay.management.utils import print_status
 
 IGNORE_FILENAMES = {
@@ -51,7 +51,7 @@
   for dir in find_template_dir(kay.KAY_DIR, ('debug','app_template')):
     dest = prepare_destdir(dir)
     print_status("Now compiling templates in %s to %s." % (dir, dest))
-    compile_dir(env, dir, dest)
+    #compile_dir(env, dir, dest)
   print_status("Finished compiling bundled templates...")
 
 
@@ -113,4 +113,4 @@
   for dir in target_dirs:
     dest = prepare_destdir(dir)
     print_status("Now compiling templates in %s to %s." % (dir, dest))
-    compile_dir(env, dir, dest)
+    #compile_dir(env, dir, dest)

Prateek Malhotra

unread,
Nov 19, 2011, 2:41:10 PM11/19/11
to kay-...@googlegroups.com
I re-included the jinja2utils package as its required to pre-compile the templates before deployment. You shouldn't comment it out but add the package back so that in production your running off precompiled templates versus having to parse it (assuming my knowledge of how KAY's implementation is meant to work is correct).

-Prateek

--
You received this message because you are subscribed to the Google Groups "kay-users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/kay-users/-/jbCPOht7vKgJ.

Paolo Casciello

unread,
Nov 20, 2011, 11:55:31 AM11/20/11
to kay-...@googlegroups.com
Yes, your solution is correct.

now i don't need to go on production with the py27 branch :)

Takashi Matsuo

unread,
Nov 21, 2011, 2:47:09 AM11/21/11
to kay-...@googlegroups.com

Why I'm going to remove jinja2 preparse is that python2.7 runtime can use bytecode, so jinja2 can use bytecode cache, which is not available with python2.5 runtime. I've just committed a change at:

What do you guys think?

-- 
Takashi Matsuo
matsuo....@gmail.com
Kay's daddy


2011/11/21 Paolo Casciello <paolo.c...@gmail.com>
Yes, your solution is correct.

now i don't need to go on production with the py27 branch :)

--
You received this message because you are subscribed to the Google Groups "kay-users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/kay-users/-/6kuq3XJQFAEJ.

Gopal Patel

unread,
Nov 21, 2011, 3:38:41 AM11/21/11
to kay-...@googlegroups.com
right.

you can also completely remove jinja lib from source tree too, since it is also available via sdk too.

Paolo Casciello

unread,
Nov 21, 2011, 5:42:31 AM11/21/11
to kay-...@googlegroups.com
gops, it is removed. We're talking about the py27 branch.

to develop with gae + kay in py27 you need jinja2 installed on your system



Paolo Casciello

unread,
Nov 21, 2011, 6:48:51 AM11/21/11
to kay-...@googlegroups.com
With latest updates it works directly after checkout.
It's true, as stated in ( http://code.google.com/appengine/docs/python/python27/newin27.html ), Jinja2 can create bytecodes.

In http://code.google.com/appengine/docs/python/python27/using27.html#Configuring_Libraries is advised to include also markupsafe and setuptools so we could add them in the app.yaml base template.


Reply all
Reply to author
Forward
0 new messages