Docker Spaces are incompatible with Django

Hello,

I’ve been trying to get my containerized Django application up and running in a docker space for a few weeks now, but I think there is some incompatibility.

I made a simple hello world application to help illustrate the error:

The index just doesn’t show at all.

This app works fine when I run it locally though. It just shows hello world.

Regards,
Caz

1 Like

Hello @CazC,

This error is due Django security features. Since the Space is embed on huggingface.co via an Iframe you need to add this to your settings.py

X_FRAME_OPTIONS = 'ALLOW-FROM https://huggingface.co/'

read more here

1 Like

That’s it thank you!
I would have never figured that out.

1 Like