Question

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

I need to setup crossdomain.xml - currently getting 'access denied' etc when trying to play flash movs

whats the best way to set this up?

Was it helpful?

Solution

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.

OTHER TIPS

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).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top