Using Python Django we have created Rest API. Now we want connect Power Pages with Rest API and it is throwing an error. Below Are the details of Error.
I totally agree with @ragavanrajan - if you can go with Web API to send data from Power Pages to Dataverse. However, if external integration is needed you can avoid CORS issues by configuring your Django server to accept requests from Power Pages by adding the Power Pages URL as the allowed origin. Similarly you can configure CORS on Power Pages side - see official docs here https://learn.microsoft.com/mt-mt/power-pages/configure/cors-support
Hi @Bharathhm
Welcome to the Power Pages forum. I am not sure whether you have explored Portals web API. Official docs here
you can build most of the functionalities without writing your own data using API.
Power Pages is tightly coupled with Dataverse. You can achieve many things using the OOB functionality.
Enough of my lecture,
You have few options here to fix the issue
1. You can do simple Ajax calls
2. You can try fetch call. Check this blog
3. Use Power Automate and HTTP trigger and return the value to Power Pages. Official URL
Assuming you are doing Ajax call, then the next step is to "enable implicit grant flow" to avoid the CORS issue
@OliverRodrigues & @OOlashyn - anything I am missing here?
Hope it helps.
------------
If you like this post, give it a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users to find it.