Hello! I am trying to implement dhtmlxgantt in a django project but am consistently getting 403 errors when making PUT, POST and DELETE requests in the frontend. Hoping someone can help with this.
For context, I want to use the gantt api in a django project with a few other applications. I initially included the gantt views and urls in one of the other apps. When I did this I could view tasks and links, but immediately got 403 errors when trying to add tasks and links from the frontend. Details of the error showed that this was related with a missing or invalid csrf token. I tried disabling csrf middleware and adding csrf exemption decorators to the gantt views, but this didn’t work. I tested the endpoints by sending data using forms I created in my html and this worked fine, showing that the problem was elsewhere.
Afterwards, I thought there might be server settings or other issues causing the problem, so I decided to create a new project. I started the project by building a standalone gantt app, following the dhtmlxGantt with Python Gantt Docs tutorial. The standalone gantt app worked perfectly after which I brought in code for the other apps into my project (mainly templates, views and urls). The gantt app still worked well as long as I used it with urls within that app. However, if I redirect to other apps e.g. to an app handling authentication, and back into the gantt again, the 403 errors start and persist.
I wonder whether anyone else has faced similar issues and can help with ideas to resolve this. Also not sure whether this is by design - maybe the api cannot be used in projects that require redirecting to/from other applications. Would appreciate thoughts and assistance.