Given you already have a command-line way of running your tests, you can easily take that to a Run Configuration in Pycharm (this works for Pycharm Community edition) by telling it to run the manage.py file and then adding parameters needed to run tests.
For example, let's say you have a Django root project folder containing an app folder and then a "tests" subfolder in it ("tests" could even have more subfolders for each test category). So the path would be something like: root_project/app/tests. I assume this tests folder has an __init__.py file and also if there are subfolders within "tests" they would also have an __init__.py each. So a viable command to run these tests could be
python manage.py test app.tests.<module>.<file>
Given this command, you can create a Run Configuration in Pycharm by going to Run > Edit configurations > (click on "+") and select Python (just plain "Python", not "Python tests"). Give it any name you want (e.g.: "run unit tests") and then add:
- "Script" field: the path to your manage.py file (e.g.: project_root/manage.py)
- "Parameters": whatever you put in your command after
python manage.py, so in the example I used above it would be test app.tests.<module>.<file>
- "Python interpreter": if not automatically selected, choose the same interpreter you're using when you run your tests by command. For example, it could be the interpreter in a virtual environment.
Other fields should be auto-populated, but just in case make sure "Working directory" shows your project root folder and that "Add content roots to PYTHONPATH" and "Add source roots to PYTHONPATH" are selected.
Of course, in this example you would replace "[module]" with whatever subfolder you want to run in your tests folder or just remove it completely if no subfolders exist. And also replace "[file]" with the test file you're trying to run.

Just save this configuration and you can use it to run or debug your tests by just selecting the run configuration you created and then clicking on the button you need:

Debug Unittests for test_...command in the sidebar next to your test? And in the bottom console, the name of the tab that opens is "Debug"?