ForestAdmin / django-forestadmin

🐍 Django agent for Forest Admin to integrate directly to your existing Django backend application.
https://www.forestadmin.com
GNU General Public License v3.0
123 stars 18 forks source link

Onboarding - CORS configuration can conflict with django-cors-headers app configuration if used #69

Closed arnaudbesnier closed 2 years ago

arnaudbesnier commented 3 years ago

Expected behavior

Using the app django-cors-headers, the onboarding should be smooth.

Actual behavior

Onboarding on a Django backend using the app django-cors-headers seems to conflict with the agent CORS configuration and does not let the Forest Admin client request the backend. By manually adding app.forestadmin.com, as an authorized domain to the django-cors-headers configuration, we manage to bypass the issue.

Context

arnaudbesnier commented 3 years ago

Maybe the only thing we can do is to write a documentation similar to the Ruby on Rails one: https://docs.forestadmin.com/documentation/how-tos/setup/configuring-cors-headers

GuillaumeCisco commented 3 years ago

django-cors-headers is used by django-forestadmin : https://github.com/ForestAdmin/django-forestadmin/blob/main/django_forest/utils/cors.py If it helps

ENV variable can be overridden form the FOREST django settings as done for the documentation on ruby on rails ;)

vamonte commented 2 years ago

The cors policies settings are been updated in this PR https://github.com/ForestAdmin/django-forestadmin/pull/77 . It fixes the CORS issues.