Python 如何将.swf文件嵌入到我的Google应用程序引擎应用程序中?

Python 如何将.swf文件嵌入到我的Google应用程序引擎应用程序中?,python,django,flash,google-app-engine,static,Python,Django,Flash,Google App Engine,Static,首先,我是新来的,所以如果我犯了任何错误,请指出 我正在用python开发一个应用程序引擎项目,我希望能够上传和玩.swf格式的游戏。我在让AppEngine发送(传递、渲染、显示,…不确定正确的术语是什么)以.swf结尾的文件时遇到问题 我做错了什么? 我已经尝试在我的对象标记中嵌入一张图片,以确保我的html和Django模板不是导致这个问题的原因,并且工作正常 这是我的app.yaml文件 application: flashstealer version: 1 runtime: pyth

首先,我是新来的,所以如果我犯了任何错误,请指出

我正在用python开发一个应用程序引擎项目,我希望能够上传和玩.swf格式的游戏。我在让AppEngine发送(传递、渲染、显示,…不确定正确的术语是什么)以.swf结尾的文件时遇到问题

我做错了什么?

我已经尝试在我的对象标记中嵌入一张图片,以确保我的html和Django模板不是导致这个问题的原因,并且工作正常

这是我的app.yaml文件

application: flashstealer
version: 1
runtime: python
api_version: 1

handlers:
- url: /stylesheets
  static_dir: stylesheets

- url: /images
  static_dir: images

- url: /flashgames
  static_dir: flashgames

- url: .*
  script: main.py
…还有我的主菜

import wsgiref.handlers
from google.appengine.ext import db
from google.appengine.ext import webapp
from google.appengine.ext.webapp import template

class Game(db.Model):
    name = db.StringProperty()
    description = db.StringProperty()
    tags = db.StringListProperty()
    playcount = db.IntegerProperty()
    location = db.StringProperty()
    originallocation = db.StringProperty()

class MyHandler(webapp.RequestHandler):
    def get(self):
        games = db.GqlQuery('SELECT * FROM Game LIMIT 20')
        self.response.out.write(template.render('main.html',{'games': games}))
    def post(self):
        game = Game(
            name = self.request.get('name'),
            description = self.request.get('description'),
            #tags = self.request.get('tags'),
            #playcount = self.request.get('playcount'),
            location = self.request.get('location'),
            originallocation = self.request.get('originallocation'))
        game.put()
        self.redirect("/")
def main():
    app = webapp.WSGIApplication([(r'.*', MyHandler)],debug=True)
    wsgiref.handlers.CGIHandler().run(app)

if __name__ == '__main__':
    main()
…还有我的main.html

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Emporium by Free Css Templates</title>
<meta name="keywords" content="" />
<meta name="description" content="" />
<link href="stylesheets/default.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="wrapper">
<!-- start header -->
<div id="logo">
    <h1><a href="#">The Arcade</a></h1>
    <h2> &raquo;&nbsp;&nbsp;&nbsp;but just a fondation for now</h2>
</div>
<div id="header">
    <div id="menu">
        <ul>
            <li class="current_page_item"><a href="#">Homepage</a></li>
            <li><a href="#">Blogs</a></li>
            <li><a href="#">Photos</a></li>
            <li><a href="#">About</a></li>
            <li class="last"><a href="#">Contact</a></li>
        </ul>
    </div>
</div>
<!-- end header -->
</div>
<!-- start page -->
<div id="page">
    <!-- start content -->
    <div id="content">
        {% for game in games %}
        <div class="post">
            <h1 class="title">{{game.name}}</h1>
            <div class="entry">
                <embed src="{{game.location}}" width="100%" height="400">
                <p>{{game.description}}</p>
            </div>
            <div class="meta">
                <p class="links">
                    <a href="#" class="more">Read full article</a> 
                        <b>|</b> 
                    <a href="#" class="comments">Play Count ({{game.playcount}})</a>
                </p>
            </div>
        </div>
        {% endfor %}
        <div class="post">
            <h2 class="title">Submit Games Here</h2>
            <div class="entry">
            <form action="" method="post">
            <fieldset>
            Name:<p><input type="stringfield" name="name" ></p>
            Descrition:<p><input type="stringfield" name="description"></p>
            Original Location:<p><input type="stringfield" name="originallocation"></p>
            Playcount:<p><input type="stringfield" name="playcount" ></p>
            Location:<p><input type="stringfield" name="location"></p>
            Tags:<p><input type="stringfield" name="tags"></p>
            <p><input type="submit" value="post"></p>
            </fieldset>
            </form>
            </div>
            <div class="meta">
                <p class="links">
                                <a href="#" class="more">Read full article</a> 
                                <b>|</b> 
                                <a href="#" class="comments">Comments (32)</a>
                            </p>
            </div>
        </div>
    </div>
    <!-- end content -->
    <!-- start sidebar -->
    <div id="sidebar">
        <ul>
            <li id="search">
                <h2>Search</h2>
                <form method="post" action="">
                    <fieldset>
                    <input type="text" id="message" name="message" value="" />
                    <input type="submit" id="x" value="Search" />
                    </fieldset>
                </form>
            </li>
            <li>
                <h2>To Do</h2>
                <ul>
                    <li><a href="#">make a list of games in db</a></li>

                </ul>
            </li>
        </ul>
    </div>
    <!-- end sidebar -->
    <div style="clear: both;">&nbsp;</div>
</div>
<!-- end page -->
<!-- start footer -->
<div id="footer">
    <p id="legal"></p>
</div>
<!-- end footer -->
</body>
</html>

商场免费Css模板
&拉阔;但现在只是一个基金会
{游戏%中游戏的%} {{game.name} {{game.description}

|

{%endfor%} 在这里提交游戏 姓名:

描述:

原始位置:

播放次数:

地点:

标签:

|

  • 搜寻

因为我是新手,所以不能直接上传照片

这是当我查看呈现的(无论它叫什么)html时显示的方式


商场免费Css模板
&拉阔;但现在只是一个基金会
使用.swf进行测试 这是问题的开始,因为它留下了游戏应该在的位置,但没有游戏。

|

使用.img进行测试 这证明不是我的html和模板导致了问题

|

在这里提交游戏 名称:

描述:

原始位置:

播放次数:

地点:

标签:

|

  • 搜寻

(c)2008年。版权所有。设计人。

这些是“我的根目录”中的文件夹及其内容

  • 图像
    • img01.jpg
    • img02.jpg
    • img03.jpg
    • spacer.gif
  • 闪光游戏
    • aow2.swf
  • 样式表
    • default.css

这看起来不像是嵌入flash应用程序的标准方式,也不是应用程序引擎的问题。你已经有了一个对象标签,除了维度什么都没有,里面还有一个嵌入标签,除了URL什么都没有。您是否尝试过使用一些标准的嵌入标记来执行此操作?Flash环境应该提供一种简单的方法来导出嵌入在HTML页面中的应用程序。您是否尝试过使用磁盘上的一个简单静态HTML文件来完成此操作,以便更容易调试并将App Engine从等式中删除?

好的,删除了标记,但仍然存在相同的问题,您现在可以帮助我吗?请注意。@Jonathan删除对象标记不是我建议的。您是否尝试过我的建议,例如使用Flash生成包含您的应用程序的静态HTML文件?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"> 
<head> 
<meta http-equiv="content-type" content="text/html; charset=utf-8" /> 
<title>Emporium by Free Css Templates</title> 
<meta name="keywords" content="" /> 
<meta name="description" content="" /> 
<link href="stylesheets/default.css" rel="stylesheet" type="text/css" /> 
</head> 
<body> 
<div id="wrapper"> 
<!-- start header --> 
<div id="logo"> 
    <h1><a href="#">The Arcade</a></h1> 
    <h2> &raquo;&nbsp;&nbsp;&nbsp;but just a fondation for now</h2> 
</div> 
<div id="header"> 
    <div id="menu"> 
        <ul> 
            <li class="current_page_item"><a href="#">Homepage</a></li> 
            <li><a href="#">Blogs</a></li> 
            <li><a href="#">Photos</a></li> 
            <li><a href="#">About</a></li> 
            <li class="last"><a href="#">Contact</a></li> 
        </ul> 
    </div> 
</div> 
<!-- end header --> 
</div> 
<!-- start page --> 
<div id="page"> 
    <!-- start content --> 
    <div id="content"> 

        <div class="post"> 
            <h1 class="title">Test with .swf</h1> 
            <div class="entry">
                <embed src="/flashgames/aow2.swf">
                <p>This is were the problem starts because it leaves a spot where the game should be but there's no game.</p> 
            </div> 
            <div class="meta"> 
                <p class="links"> 
                    <a href="#" class="more">Read full article</a> 
                        <b>|</b> 
                    <a href="#" class="comments">Play Count (None)</a> 
                </p> 
            </div> 
        </div> 

        <div class="post"> 
            <h1 class="title">Test with .img</h1> 
            <div class="entry"> 
                <object width="100%" height="400"> 
                <embed src="/images/img01.jpg"> 
                </object> 
                <p>This is proof that it's not my html and template that's causing the problem</p> 
            </div> 
            <div class="meta"> 
                <p class="links"> 
                    <a href="#" class="more">Read full article</a> 
                        <b>|</b> 
                    <a href="#" class="comments">Play Count (None)</a> 
                </p> 
            </div> 
        </div> 

        <div class="post"> 
            <h2 class="title">Submit Games Here</h2> 
            <div class="entry"> 
            <form action="" method="post"> 
            <fieldset> 
            Name:<p><input type="stringfield" name="name" ></p> 
            Descrition:<p><input type="stringfield" name="description"></p> 
            Original Location:<p><input type="stringfield" name="originallocation"></p> 
            Playcount:<p><input type="stringfield" name="playcount" ></p> 
            Location:<p><input type="stringfield" name="location"></p> 
            Tags:<p><input type="stringfield" name="tags"></p> 
            <p><input type="submit" value="post"></p> 
            </fieldset> 
            </form> 
            </div> 
            <div class="meta"> 
                <p class="links"><a href="#" class="more">Read full article</a> <b>|</b> <a href="#" class="comments">Comments (32)</a></p> 
            </div> 
        </div> 
    </div> 
    <!-- end content --> 
    <!-- start sidebar --> 
    <div id="sidebar"> 
        <ul> 
            <li id="search"> 
                <h2>Search</h2> 
                <form method="post" action=""> 
                    <fieldset> 
                    <input type="text" id="message" name="message" value="" /> 
                    <input type="submit" id="x" value="Search" /> 
                    </fieldset> 
                </form> 
            </li> 
            <li> 
                <h2>To Do</h2> 
                <ul> 
                    <li><a href="#">make a list of games in db</a></li> 

                </ul> 
            </li> 
        </ul> 
    </div> 
    <!-- end sidebar --> 
    <div style="clear: both;">&nbsp;</div> 
</div> 
<!-- end page --> 
<!-- start footer --> 
<div id="footer"> 
    <p id="legal">( c ) 2008. All Rights Reserved. <a href="http://www.freecsstemplates.org/">Bestfriends</a> designed by <a href="http://www.freecsstemplates.org/">Free CSS Templates</a>.</p> 
</div> 
<!-- end footer --> 
</body> 
</html>