代码之家  ›  专栏  ›  技术社区  ›  zack

如何在django中处理crossdomain.xml?

  •  1
  • zack  · 技术社区  · 15 年前

    我正在运行一个ubuntuvm-django在nginx后面的apache2下运行

    我需要设置crossdomain.xml-在尝试播放flashmov时,当前正在获取“拒绝访问”等

    3 回复  |  直到 15 年前
        1
  •  2
  •   Carl Meyer    15 年前

    你也可以试试 django-flashpolicies

        2
  •  1
  •   jujule    15 年前

    您可以让nginx为您提供crossdomain.xml。您可以找到一个配置示例 here

    这是更有效和网站范围内,如果你喜欢。

        3
  •  1
  •   whncode    11 年前

    另一种解决方案是在应用程序中创建视图,处理来自flash的请求:

    def crossdomain(request, **kwargs):
        return render(request, 'crossdomain.xml', {})
    

    将crossdomain.xml放入templates dir,并将模式添加到url.py:

    (r'^crossdomain.xml', 'projectname.appname.views.crossdomain')
    

    (在使用cache over django之前,这对生产服务器不好)。