Web View Django Project Template Error

In a pre-made Django project on IDX.
When creating a superuser and logging in with the ‘./admin’ link, I cannot log in to the Django admin page.
I hope solution for IDX. Thanks

1 Like

I got the same error, Any solution yet?

same issue here is there any solution yet ?

Thanks for flagging! We’ll take a look at what is going on here.

Have you tried adding the host in ALLOWED_HOSTS in settings.py?

Something like this -

ALLOWED_HOSTS = [
    "127.0.0.1",
    "9000-idx-ddd-1721671583840.cluster-y5qn7andqbhuisvzejdefmihmk.cloudworkstations.dev"
]

CSRF_TRUSTED_ORIGINS = [
    'https://9000-idx-ddd-1721671583840.cluster-y5qn7andqbhuisvzejdefmihmk.cloudworkstations.dev'
]

1 Like

A worthy try, but did not help, I’m still stuck on the issue.
Tried to comment out things like 'django.middleware.csrf.CsrfViewMiddleware' but that did not help either.

I managed to solve it like this

settings.py

ALLOWED_HOSTS = [
    "127.0.0.1",
    "localhost",
    "8000-idx-workspace.dev",
]

CSRF_TRUSTED_ORIGINS = [
    "http://0.0.0.0",
    "http://localhost",
    "https://8000-idx-workspace.dev",
]
1 Like

All bro! This is my fix for now. Click a new tab and log in to the admin successfully.


Hope IDX team fix soon!