弹性 4 + Django:测试和发布选项
我正在创建一个基于 django 的网站,该网站将为偶尔通过 pyamf 访问数据的 Flash 应用程序提供服务。我需要能够在 django 框架的上下文中轻松测试 flash,即使用所有登录 cookie 和所有可用的内容,以便当我进行 pyamf 调用时,它具有所有用户上下文。我需要能够以合理的方式测试并释放 swf 和包装 html。但是:
- flex 中的 html 模板已经是模板,因此如果我将 django 的模板代码放入其中,它会在创建 flashapp.html 之前被删除。
- html 和 swf 自动发布到同一目录,但我希望它们转到不同的目录,因为 swf 不应该由 django 提供服务,而 html 应该位于 django 控制的区域中。
乍一看,这让我相信我需要:
- 一种将 html 和 swf 文件发布到不同位置的方法。 (我不知道如何做到这一点。)
- 一种将 html 作为存根(没有 html/body 标记)发布的方法,以便我可以从 django 中的另一个位置包含它们。 (我想只是从index.template.html中删除我不想要的内容?)
- 然后我可以将flex指向django站点,该站点又包含生成的flashapp.html,而flashapp.html又引用了swf,并且它应该所有工作。 (我认为,通过将备用 html 提供给运行/调试设置。)
所以我的问题归结为:
- 上面是执行此操作的最佳方法,还是这甚至是正确的方向?
- 如果是这样,如何将html和swf发布到不同的目录? (对于debug和release模式,是否有两种不同的方法。)
- 如果不是,怎样才是正确的?
如果我对这个主题有任何其他一般性建议,请随时分享。 :-)
I am creating a django-based site that will serve flash apps that occasionally access data via pyamf. I need to be able to easily test the flash in the context of the django framework, i.e. with all the login cookies and everything available, so that when I make a pyamf call, it has all the user context there. And I need to be able to test and release both the swf's and the wrapper html's in a sane way. However:
- The html templates in flex are already templates, so if I put template code in there for django, it gets scraped out before the flashapp.html is created.
- The html's and swf's automatically get released to the same directory, but I want them to go to different directories because the swf's shouldn't be served by django and the html's should be in an area in control of django.
This leads me to believe, at first glance, that I need:
- A way of having the html and swf files be released to different locations. (I don't know how to do this.)
- A way of releasing the html's as stubs (no html/body tag) so that I can include them from another location in django. (I guess just strip what I don't want from the index.template.html?)
- Then I can point flex to go to the django site that in turn includes the generated flashapp.html that in turn references the swf, and it should all work. (By feeding that alternate html to the run/debug settings, I assume.)
So my question comes down to:
- Is the above the best way of doing this, or is this even the right direction?
- If so, how do I release the html and swf to different directories? (For debug and release mode, if there are two different methods.)
- If not, what is proper?
And if there are any other general bits of advice for me on this topic, please feel free to share. :-)