有没有人试过将appengine 移植到django?

14 views
Skip to first unread message

google app engine

unread,
May 22, 2009, 10:01:16 AM5/22/09
to Google App Engine 中文开发组
移植的成本大不大?

@@

unread,
May 22, 2009, 10:06:10 AM5/22/09
to google-app-e...@googlegroups.com
没看明白你的意思。

一个是平台一个是框架 不知道怎么移植

2009/5/22 google app engine <cali...@gmail.com>
移植的成本大不大?

Google App Engine

unread,
May 22, 2009, 10:19:42 AM5/22/09
to google-app-engine-cn-dev
那好吧。
将appengine的python代码移植成django的代码。
 
 
2009-05-22

Google App Engine

发件人: @@
发送时间: 2009-05-22  22:06:40
收件人: google-app-engine-cn-dev
抄送:
主题: Re: 有没有人试过将appengine 移植到django?

@@

unread,
May 22, 2009, 10:43:23 AM5/22/09
to google-app-e...@googlegroups.com
这个在appengine网站的articles里有一篇文章介绍了一个工具 能直接转换。
但是我没实际用过 可以去找来看看

2009/5/22 Google App Engine <cali...@gmail.com>

guangquanzhang

unread,
Jan 17, 2010, 2:51:05 AM1/17/10
to google-app-e...@googlegroups.com
这两天怎么又访问不了appspot.com :-(

--
Thanks


guru

unread,
Jan 17, 2010, 3:03:54 AM1/17/10
to google-app-e...@googlegroups.com
不能吧 ,

2010/1/17 guangquanzhang <guangqu...@gmail.com>
这两天怎么又访问不了appspot.com :-(

--
Thanks



杨浩

unread,
Jan 17, 2010, 4:05:06 AM1/17/10
to google-app-e...@googlegroups.com
Just GAE is unstable!

2010/1/17 guru <perc...@gmail.com>

李白,字一日

unread,
Jan 17, 2010, 6:35:09 AM1/17/10
to google-app-e...@googlegroups.com
一直不稳定。

2010/1/17 杨浩 <skzr.org@gmail.com>
--
您收到此信息是由于您订阅了 Google 论坛“Google App Engine 中文开发组”论
坛。
要在此论坛发帖,请发电子邮件到 google-app-e...@googlegroups.com
要退订此论坛,请发邮件至
google-app-engine-...@googlegroups.com
更多选项,请通过
https://groups.google.com/group/google-app-engine-cn-dev?hl=zh-CN?hl=zh-CN
访问该论坛


guangquanzhang

unread,
Jan 17, 2010, 7:19:46 AM1/17/10
to google-app-e...@googlegroups.com
妈的,我用netbeans开发,运行服务器怎么还是运行旧文件 :-[


李白,字一日 写道:

王昭

unread,
Jan 17, 2010, 9:58:56 PM1/17/10
to google-app-e...@googlegroups.com
似乎是每天上午某一固定时段不能访问,下午就好了……

2010/1/17 guangquanzhang <guangqu...@gmail.com>



--
PKU COE BIOMED 06 WANGZHAO

杨浩

unread,
Jan 18, 2010, 1:03:06 AM1/18/10
to google-app-e...@googlegroups.com
杯具阿!
图标里面竟然有河蟹 阿哈哈 杯具
2010/1/18 王昭 <woodspr...@gmail.com>
1E3.gif
982.gif

jinzhou shi

unread,
Jan 18, 2010, 1:41:37 AM1/18/10
to google-app-e...@googlegroups.com


2010/1/18 杨浩 <skzr.org@gmail.com>
1E3.gif
982.gif

guangquanzhang

unread,
Jan 18, 2010, 1:51:01 AM1/18/10
to google-app-e...@googlegroups.com
真是一个河蟹之群啊


jinzhou shi 写道:


2010/1/18 杨浩 <skzr.org@gmail.com>
杯 具阿!
图标里面竟然有河蟹 阿哈哈 杯具
2010/1/18 王昭 <woodspr...@gmail.com>
似 乎是每天上午某一固定时段不能访问,下午就好了……


2010/1/17 guangquanzhang <guangqu...@gmail.com>
妈的,我用netbeans开发,运行服务器怎么还是运行旧文件 :-[

--
您收到此信息是由于您订阅了 Google 论坛“Google App Engine 中文开发组”论
坛。
要在此论坛发帖,请发电子邮件到 google-app-e...@googlegroups.com
要退订此论坛,请发邮件至
google-app-engine-...@googlegroups.com
更多选项,请通过
https://groups.google.com/group/google-app-engine-cn-dev?hl=zh-CN?hl=zh-CN
访问该论坛




--
Thanks

>> What I said is licenced under CC-by-nd :)

Email: java...@baturu.com
Blog: http://blog.baturu.com

guangquanzhang

unread,
Jan 19, 2010, 2:08:32 AM1/19/10
to google-app-e...@googlegroups.com
有想探讨Java Web方面的同行吗? 看了一下 google group,发现没有几个这方面的group,所以我创建了一个,希望找一些同行们,能够一起高质量探讨技术问题。感兴趣的请加,不感兴趣的就抱歉打扰了
https://groups.google.com/group/web-based-java-in-china


jinzhou shi 写道:


2010/1/18 杨浩 <skzr.org@gmail.com>
杯 具阿!
图标里面竟然有河蟹 阿哈哈 杯具
2010/1/18 王昭 <woodspr...@gmail.com>
似 乎是每天上午某一固定时段不能访问,下午就好了……


2010/1/17 guangquanzhang <guangqu...@gmail.com>
妈的,我用netbeans开发,运行服务器怎么还是运行旧文件 :-[

--
您收到此信息是由于您订阅了 Google 论坛“Google App Engine 中文开发组”论
坛。
要在此论坛发帖,请发电子邮件到 google-app-e...@googlegroups.com
要退订此论坛,请发邮件至
google-app-engine-...@googlegroups.com
更多选项,请通过
https://groups.google.com/group/google-app-engine-cn-dev?hl=zh-CN?hl=zh-CN
访问该论坛

杨浩

unread,
Jan 19, 2010, 10:55:03 AM1/19/10
to google-app-e...@googlegroups.com
https://groups.google.com
https访问已经被
杯具

2010/1/19 guangquanzhang <guangqu...@gmail.com>
1E3.gif
982.gif

guangquanzhang

unread,
Jan 19, 2010, 8:06:37 PM1/19/10
to google-app-e...@googlegroups.com
GFW偶尔会作一下恶


杨浩 写道:

李白,字一日

unread,
Jan 19, 2010, 8:20:49 PM1/19/10
to google-app-e...@googlegroups.com
呵呵, GFW的目标不是做恶吗?

2010/1/20 guangquanzhang <guangqu...@gmail.com>
1E3.gif
982.gif

guangquanzhang

unread,
Jan 22, 2010, 8:54:21 PM1/22/10
to google-app-e...@googlegroups.com
哪位有新蛋网的蛋券,送我一张? :-)

李白,字一日 写道:
呵呵, GFW的目标不是做恶吗?

2010/1/20 guangquanzhang <guangqu...@gmail.com>
GFW偶尔会作一下恶


杨浩 写道:
https://groups.google.com
https访问已经被
杯具

2010/1/19 guangquanzhang <guangqu...@gmail.com>
有想探讨Java Web方面的同行吗? 看了一下 google group,发现没有几个这方面的group,所以我创建了一个,希望找一些同行们,能够一起高质量探讨技术问题。感兴趣的请加,不感兴趣的就抱歉打扰了
https://groups.google.com/group/web-based-java-in-china


jinzhou shi 写道:


2010/1/18 杨浩 <skzr.org@gmail.com>
杯 具阿!
图标里面竟然有河蟹 阿哈哈 杯具
2010/1/18 王昭 <woodspr...@gmail.com>
似 乎是每天上午某一固定时段不能访问,下午就好了……


2010/1/17 guangquanzhang <guangqu...@gmail.com>
妈的,我用netbeans开发,运行 服务器怎 么还是运行旧文件 :-[


--
Thanks

>> What I said is licenced under CC-by-nd :)

Email: java...@baturu.com
Blog: http://blog.baturu.com
    

guangquanzhang

unread,
Jan 23, 2010, 3:02:19 AM1/23/10
to google-app-e...@googlegroups.com
appengine 文档上明明已经说明是支持 filter 的,可我的 filter 死活不拦截请
求,大家帮我看看,是否是我哪里有白痴的错误。 :-[
在 web.xml 定义如下
<filter>
<filter-name>SiteMeshFilter</filter-name>
<filter-class>com.oss.velocity.SiteMeshFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>SiteMeshFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>

filter 类如下:

/**
* Core Filter for integrating SiteMesh into a Java web application.
*
* @author Joe Walnes
* @author Scott Farquhar
* @since SiteMesh 3
*/
public class SiteMeshFilter implements Filter {

private FilterConfig filterConfig;
private static final String ALREADY_APPLIED_KEY =
"com.opensymphony.sitemesh.APPLIED_ONCE";

public void init(FilterConfig filterConfig) {
this.filterConfig = filterConfig;
}

public void destroy() {
filterConfig = null;
}

/**
* Main method of the Filter.
* <p>Checks if the Filter has been applied this request. If not,
parses the page
* and applies {@link com.opensymphony.module.sitemesh.Decorator}
(if found).
*/
public void doFilter(ServletRequest rq, ServletResponse rs,
FilterChain chain)
throws IOException, ServletException {
System.err.println("===================");
HttpServletRequest request = (HttpServletRequest) rq;
HttpServletResponse response = (HttpServletResponse) rs;
ServletContext servletContext = filterConfig.getServletContext();

SiteMeshWebAppContext webAppContext = new
SiteMeshWebAppContext(request, response, servletContext);

ContentProcessor contentProcessor =
initContentProcessor(webAppContext);
DecoratorSelector decoratorSelector =
initDecoratorSelector(webAppContext);

if (filterAlreadyAppliedForRequest(request)) {
// Prior to Servlet 2.4 spec, it was unspecified whether the
filter should be called again upon an include().
chain.doFilter(request, response);
return;
}

if (!contentProcessor.handles(webAppContext)) {
// Optimization: If the content doesn't need to be
processed, bypass SiteMesh.
chain.doFilter(request, response);
return;
}

try {

Content content = obtainContent(contentProcessor,
webAppContext, request, response, chain);

if (content == null) {
return;
}

Decorator decorator =
decoratorSelector.selectDecorator(content, webAppContext);
decorator.render(content, webAppContext);

} catch (IllegalStateException e) {
// Some containers (such as WebLogic) throw an
IllegalStateException when an error page is served.
// It may be ok to ignore this. However, for safety it is
propegated if possible.
} catch (RuntimeException e) {
throw e;
} catch (ServletException e) {
request.setAttribute(ALREADY_APPLIED_KEY, null);
throw e;
}

}

protected ContentProcessor
initContentProcessor(SiteMeshWebAppContext webAppContext) {
// TODO: Remove heavy coupling on horrible SM2 Factory
Factory factory = Factory.getInstance(new Config(filterConfig));
factory.refresh();
return new PageParser2ContentProcessor(factory);
}

protected DecoratorSelector
initDecoratorSelector(SiteMeshWebAppContext webAppContext) {
// TODO: Remove heavy coupling on horrible SM2 Factory
Factory factory = Factory.getInstance(new Config(filterConfig));
factory.refresh();
return new
DecoratorMapper2DecoratorSelector(factory.getDecoratorMapper());
}

/**
* Continue in filter-chain, writing all content to buffer and parsing
* into returned {@link com.opensymphony.module.sitemesh.Page}
object. If
* {@link com.opensymphony.module.sitemesh.Page} is not parseable,
null is returned.
*/
private Content obtainContent(ContentProcessor contentProcessor,
SiteMeshWebAppContext webAppContext,
HttpServletRequest request,
HttpServletResponse response, FilterChain chain)
throws IOException, ServletException {

ContentBufferingResponse contentBufferingResponse = new
ContentBufferingResponse(response, contentProcessor, webAppContext);
chain.doFilter(request, contentBufferingResponse);
// TODO: check if another servlet or filter put a page object in
the request
// Content result = request.getAttribute(PAGE);
// if (result == null) {
// // parse the page
// result = pageResponse.getPage();
// }

webAppContext.setUsingStream(contentBufferingResponse.isUsingStream());
return contentBufferingResponse.getContent();
}

private boolean filterAlreadyAppliedForRequest(HttpServletRequest
request) {
if (request.getAttribute(ALREADY_APPLIED_KEY) == Boolean.TRUE) {
return true;
} else {
request.setAttribute(ALREADY_APPLIED_KEY, Boolean.TRUE);
return false;
}
}

public void setFilterConfig(FilterConfig filterConfig) {
this.filterConfig = filterConfig;
}

public FilterConfig getFilterConfig() {
return filterConfig;
}

}

杨浩

unread,
Jan 23, 2010, 3:04:04 AM1/23/10
to google-app-e...@googlegroups.com
支持拦截的阿!
看看后台日志,你请求拦截的地址看看输出什么了?

guangquanzhang

unread,
Jan 23, 2010, 3:07:30 AM1/23/10
to google-app-e...@googlegroups.com
我是在本地调试的,没发现这个 filter 被调用过
另外appengine上
http://code.google.com/intl/zh-CN/appengine/docs/java/config/webxml.html#Filters
doFilter方法签名为何与 java servlet api 不一致呢? 是文档错了,还是我这
里实现的 Filter 接口不对?

public void doFilter(HttpServletRequest request,
HttpServletResponse response,
FilterChain filterChain)
throws IOException, ServletException {

杨浩 写道:
> 支持拦截的阿!
> 看看后台日志,你请求拦截的地址看看输出什么了?


> --
> 您收到此信息是由于您订阅了 Google 论坛“Google App Engine 中文开发组”论
> 坛。
> 要在此论坛发帖,请发电子邮件到 google-app-e...@googlegroups.com
> 要退订此论坛,请发邮件至
> google-app-engine-...@googlegroups.com
> 更多选项,请通过
> https://groups.google.com/group/google-app-engine-cn-dev?hl=zh-CN?hl=zh-CN
> 访问该论坛

杨浩

unread,
Jan 23, 2010, 3:36:48 AM1/23/10
to google-app-e...@googlegroups.com
my filter:
<filter>
        <filter-name>struts2</filter-name>
        <filter-class>
            org.apache.struts2.dispatcher.FilterDispatcher
        </filter-class>
    </filter>
    <filter-mapping>
        <filter-name>struts2</filter-name>
        <url-pattern>*.do</url-pattern>
    </filter-mapping>

It's work good!

杨浩

unread,
Jan 23, 2010, 3:37:32 AM1/23/10
to google-app-e...@googlegroups.com
implements javax.servlet.Filter

guangquanzhang

unread,
Jan 23, 2010, 3:48:20 AM1/23/10
to google-app-e...@googlegroups.com
我刚才试了试,url-pattern 写成 /* 的时候,在context根目录下存在的文件是
不会被截获的,不存在的uri会被截获。 *.do 也是如此,文件不存在的时候才会
被截获。
url-pattern写成 /xxx/* ,都会被截获。

妈的,难道这是 google api 故意这么设计的? 之前没发现有这样的问题

杨浩 写道:

杨浩

unread,
Jan 23, 2010, 3:51:22 AM1/23/10
to google-app-e...@googlegroups.com
应该不会我的
/*.do-->/*.jsp依然正常工作

2010/1/23 guangquanzhang <guangqu...@gmail.com>

杨浩

unread,
Jan 23, 2010, 4:01:22 AM1/23/10
to google-app-e...@googlegroups.com
应该设置为:<url-pattern>*</url-pattern>吧!?

杨浩

unread,
Jan 23, 2010, 4:04:16 AM1/23/10
to google-app-e...@googlegroups.com
刚才自己写了一个,却是无法拦截/下面的

guangquanzhang

unread,
Jan 23, 2010, 4:05:31 AM1/23/10
to google-app-e...@googlegroups.com
呵呵,是吗? 是有些怪异啊。
这个filter我跑在tomcat上都是没问题的

杨浩 写道:
> 刚才自己写了一个,却是无法拦截/下面的

杨浩

unread,
Jan 23, 2010, 4:14:02 AM1/23/10
to google-app-e...@googlegroups.com
呵呵,我的应用是在一个文件夹里面,所以没注意!
gae使用后发现限制太多了,不太适合弄一些东西
Reply all
Reply to author
Forward
0 new messages