# PyCharm configuration template for testing with debugger

**URL:** <https://forum.dimagi.com/t/pycharm-configuration-template-for-testing-with-debugger/10775>\
**Category:** Developers\
**Created:** [May 3, 2024, 12:57pm UTC](https://forum.dimagi.com/t/pycharm-configuration-template-for-testing-with-debugger/10775 "2024-05-03T12:57:46Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![szymonb](https://dimagi.b-cdn.net/letter_avatar_proxy/v4/letter/s/b2d939/32.png) [@szymonb](https://forum.dimagi.com/u/szymonb)\
**Post date:** [May 3, 2024, 12:57pm UTC](https://forum.dimagi.com/t/pycharm-configuration-template-for-testing-with-debugger/10775/1 "2024-05-03T12:57:46Z")

</div>

Hello everyone,

Do any of the developers perhaps use the PyCharm UI to run tests and debug them? I am able to setup a run configuration by invoking the test as a standard python script (and running directly from terminal with manage.py test works just fine too), but when I try to use the Django test runner with a debugger attached I get all sorts of issues from modules not being found, exceptions from nose to general process errors from the OS. Thought that before I get too invested I just check if one of you fine folks may have a template already set. I'm using Ubuntu 22.04

---

<div class="post-metadata">

**Author:** ![Simon\_Kelly](https://dimagi.b-cdn.net/user_avatar/forum.dimagi.com/simon_kelly/32/494_2.png) [@Simon\_Kelly](https://forum.dimagi.com/u/Simon_Kelly)\
**Post date:** [May 8, 2024, 9:12am UTC](https://forum.dimagi.com/t/pycharm-configuration-template-for-testing-with-debugger/10775/2 "2024-05-08T09:12:10Z")

</div>

Hi

I also use PyCharm on Ubuntu. I have run tests from PyCharm before but I don't generally because it's an effort.

I think the main issue is that our `manage.py` script does a whole lot of extra things but PyCharm uses it's own script to run the tests.

In the past I've been able to run a test by running it as a 'python script' and then typing out the command as I would on the command line.

---

<div class="post-metadata">

**Author:** ![mriese](https://dimagi.b-cdn.net/letter_avatar_proxy/v4/letter/m/9dc877/32.png) [@mriese](https://forum.dimagi.com/u/mriese)\
**Post date:** [May 8, 2024, 2:42pm UTC](https://forum.dimagi.com/t/pycharm-configuration-template-for-testing-with-debugger/10775/3 "2024-05-08T14:42:00Z")

</div>

You can create a run configuration manually to run tests. I usually just change one I have.

 ![image](https://dimagi.b-cdn.net/uploads/default/original/2X/2/26abfda7c689279e6919d6bf7445a0f160fdb5d6.png)

---

<div class="post-metadata">

**Author:** ![szymonb](https://dimagi.b-cdn.net/letter_avatar_proxy/v4/letter/s/b2d939/32.png) [@szymonb](https://forum.dimagi.com/u/szymonb)\
**Post date:** [May 8, 2024, 5:50pm UTC](https://forum.dimagi.com/t/pycharm-configuration-template-for-testing-with-debugger/10775/4 "2024-05-08T17:50:35Z")

</div>

Thanks for the reply! That's been my experience so far as well, but I'll give the manage.py a closer look and see if I can make anything of it.

---

<div class="post-metadata">

**Author:** ![szymonb](https://dimagi.b-cdn.net/letter_avatar_proxy/v4/letter/s/b2d939/32.png) [@szymonb](https://forum.dimagi.com/u/szymonb)\
**Post date:** [May 8, 2024, 5:51pm UTC](https://forum.dimagi.com/t/pycharm-configuration-template-for-testing-with-debugger/10775/5 "2024-05-08T17:51:22Z")

</div>

Cheers @mriese

I got that far as well - are you able to run that in debug mode as well as run mode?

---

<div class="post-metadata">

**Author:** ![mriese](https://dimagi.b-cdn.net/letter_avatar_proxy/v4/letter/m/9dc877/32.png) [@mriese](https://forum.dimagi.com/u/mriese)\
**Post date:** [May 10, 2024, 2:48pm UTC](https://forum.dimagi.com/t/pycharm-configuration-template-for-testing-with-debugger/10775/6 "2024-05-10T14:48:10Z")

</div>

> [@szymonb](#):
>
> re you able to run that

Yes, I am able to debug with this run configuration. Are you able to do "run" with it at least or does it do neither for you?
