Using gorilla mux on appengine

1,169 views
Skip to first unread message

zeroc8

unread,
Apr 25, 2012, 3:19:37 AM4/25/12
to golan...@googlegroups.com
Hey guys, I'm trying to use gorilla mux on appengine.  I've copied the gorilla source directory to my app directory.
Appengine seems to find sessions.go but not context.go, although the file is there, as can be confirmed by cat /home/zeroc8/Projects/AppEngine/myapp/hello/code.google.com/p/gorilla/context/context.go

compile error:
/home/zeroc8/Projects/AppEngine/myapp/hello/code.google.com/p/gorilla/sessions/sessions.go:24: can't find import: "code.google.com/p/gorilla/context"

2012/04/25 09:14:40 go-app-builder: Failed building app: failed running 8g: exit status 1

Any idea why that happens?







David Symonds

unread,
Apr 25, 2012, 4:24:18 AM4/25/12
to zeroc8, golan...@googlegroups.com
What directory is your app.yaml in? The synthesised packages are named
for the directory relative to where that is.


Dave.

zeroc8

unread,
Apr 25, 2012, 11:14:12 AM4/25/12
to golan...@googlegroups.com, zeroc8
My app.yaml is in in the myapp directory.

This was my initial layout:
- myapp
-- app.yaml
-- hello
-- hello/code.google.com ....

After your message, I tried the following, couldn't get that to work either.
- myapp
-- app.yaml
-- hello
-- code.google.com ....

Rodrigo Moraes

unread,
Apr 25, 2012, 11:34:19 AM4/25/12
to golang-nuts
On Apr 25, 12:14 pm, zeroc8 wrote:
> After your message, I tried the following, couldn't get that to work either.
> - myapp
> -- app.yaml
> -- hello
> -- code.google.com ....

That's how it should work. You put packages in the root directory of
your app (where app.yaml is), so that rootPath + importPath = where
the package is.

There's something else wrong there but I have no good guess of what it
is.

-- rodrigo

zeroc8

unread,
Apr 25, 2012, 2:35:25 PM4/25/12
to golang-nuts
I tried your suggestion on my home desktop again, and it worked.
Thank you!

Luis Ángel Vicente Sánchez

unread,
Apr 25, 2012, 4:54:38 AM4/25/12
to zeroc8, golan...@googlegroups.com
I haven't used gorilla in appengine but I think that there is special context object for appengine...


Maybe in gorilla google group you will get more help:

zeroc8

unread,
Apr 26, 2012, 4:15:33 AM4/26/12
to golan...@googlegroups.com, zeroc8
>>I haven't used gorilla in appengine but I think that there is special context object for appengine...

Thanks, but I'm only using mux for now. It works, I had it in the wrong directory.
Also, gorilla contains a dev folder that contains examples, this folder needs to removed.
But now everything works fine. I love it.


Reply all
Reply to author
Forward
0 new messages