# Docker Spaces are incompatible with Django

**URL:** <https://discuss.huggingface.co/t/docker-spaces-are-incompatible-with-django/55175>\
**Category:** Spaces\
**Created:** [September 15, 2023, 8:35pm UTC](https://discuss.huggingface.co/t/docker-spaces-are-incompatible-with-django/55175 "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](https://discuss.huggingface.co/u/CazC)\
**Post date:** [September 15, 2023, 8:35pm UTC](https://discuss.huggingface.co/t/docker-spaces-are-incompatible-with-django/55175/1 "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](https://discuss.huggingface.co/u/radames)\
**Post date:** [September 15, 2023, 10:40pm UTC](https://discuss.huggingface.co/t/docker-spaces-are-incompatible-with-django/55175/2 "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](https://discuss.huggingface.co/u/CazC)\
**Post date:** [September 16, 2023, 12:36am UTC](https://discuss.huggingface.co/t/docker-spaces-are-incompatible-with-django/55175/3 "2023-09-16T00:36:41Z")

</div>

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