Debugging Dockerized Django Application Using PyCharm

I’m running a dockerized Django application using the Mac terminal and then trying to debug it using PyCharm. Is it possible to do this or do I have to run the application from within PyCharm for it to be available for debugging? Any help would be greatly appreciated. Thanks.

Source: StackOverflow