We have a couple of things to do here, then we are ready to run the application.
In settings.py:
Set DEBUG to the value of the DEBUG environment variable and update ALLOWED_HOSTS to include the ALLOWED_HOST environment variable added to your env.py file
Now that we have the two parts of our application within the same workspace, the CORS issues with the original separate projects are no longer a problem. This is because both parts of the project will come from the same base URL. Therefore, we can remove most of the code in the Django project relating to CORS.
In your settings.py file remove the line containing the import re
Remove all the CORS code, leaving only the CORS_ALLOWED_ORIGINS list
Before:
After:
That’s all the modifications done, so let’s get our development environment up and running.