# Docker Spaces are incompatible with Django

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fdocker-spaces-are-incompatible-with-django%2F55175%3E%5C
**Category:** Spaces\
**Created:** [September 15, 2023, 8:35pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fdocker-spaces-are-incompatible-with-django%2F55175 "2023-09-15T20:35:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![CazC](https://avatars.discourse-cdn.com/v4/letter/c/51bf81/32.png) [@CazC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FCazC)%5C
**Post date:** [September 15, 2023, 8:35pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fdocker-spaces-are-incompatible-with-django%2F55175%2F1 "2023-09-15T20:35:06Z")

</div>

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:

> **[DjangoDocker - a Hugging Face Space by CazC](https://huggingface.co/spaces/CazC/DjangoDocker)**
>
> Discover amazing ML apps made by the community

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

---

<div class="post-metadata">

**Author:** ![radames](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/radames/32/28246_2.png) [@radames](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fradames)%5C
**Post date:** [September 15, 2023, 10:40pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fdocker-spaces-are-incompatible-with-django%2F55175%2F2 "2023-09-15T22:40:02Z")

</div>

Hello @CazC,

This error is due Django security features. Since the Space is embed on [huggingface.co](http://huggingface.co) via an Iframe you need to add this to your [settings.py](https://huggingface.co/spaces/CazC/DjangoDocker/blob/main/testView/testView/settings.py)

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

read more here

> **[Django](https://docs.djangoproject.com/en/4.2/ref/clickjacking/#how-to-use-it)**
>
> The web framework for perfectionists with deadlines.

---

<div class="post-metadata">

**Author:** ![CazC](https://avatars.discourse-cdn.com/v4/letter/c/51bf81/32.png) [@CazC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FCazC)%5C
**Post date:** [September 16, 2023, 12:36am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fdocker-spaces-are-incompatible-with-django%2F55175%2F3 "2023-09-16T00:36:41Z")

</div>

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