开发者

How to handle crossdomain.xml in django?

I'm running an an ubuntu vm - django is running under apache2 behind nginx

I need to setup crossdomain.xml - currently getting 'access denied' 开发者_Go百科etc when trying to play flash movs

whats the best way to set this up?


You could also try django-flashpolicies, which will construct the XML for you. It does serve the crossdomain.xml file via Django, which will be less efficient than serving it statically.


You can let nginx serve the crossdomain.xml for you. you can find an example config here.

this is more efficient and site-wide if you like.


Another solution is create view in your app where you handle requests from flash:

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

Put crossdomain.xml in your templates dir, and add pattern to urls.py:

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

(it's not good for production servers until you use cache over django).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜