title: Run / Debug a Django application's UnitTests from the mouse right click context menu in PyCharm Community Edition?
body: <p>I must emphasize on <em>PyCharm <strong>Community</strong> Edition</em> which does <strong>not have any <em>Django</em> integration</strong> (<em>v<strong>2016.3.2</strong></em> at question time).</p>
  <p>I've <em>Google</em>d my problem and (surprisingly,) I did not get any answers, (of course I don't exclude the possibility that there might be some, be but I just missed them).</p>
  <p>The question is simple: in <em>PyCharm</em>, one can Run (Debug) an Unit Test (<em>TestCase</em> or one of its methods) with a simple mouse right click (from the context menu) just as in the image below:</p>
  <p><a href="https://i.stack.imgur.com/nygBW.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/nygBW.jpg" alt="Run Django Unit Test at RClick" /></a></p>
  <p>Unfortunately, that yields an exception:</p>
  <blockquote>
  <pre class="lang-py prettyprint-override"><code>Traceback (most recent call last):
      File &quot;C:\Install\PyCharm Community Edition\2016.3.2\helpers\pycharm\utrunner.py&quot;, line 254, in &lt;module&gt;
          main()
      File &quot;C:\Install\PyCharm Community Edition\2016.3.2\helpers\pycharm\utrunner.py&quot;, line 232, in main
          module = loadSource(a[0])
      File &quot;C:\Install\PyCharm Community Edition\2016.3.2\helpers\pycharm\utrunner.py&quot;, line 65, in loadSource
          module = imp.load_source(moduleName, fileName)
      File &quot;E:\Work\Dev\Django\Tutorials\proj0\src\polls\tests.py&quot;, line 7, in &lt;module&gt;
          from polls.models import Question
      File &quot;E:\Work\Dev\Django\Tutorials\proj0\src\polls\models.py&quot;, line 9, in &lt;module&gt;
          class Question(models.Model):
      File &quot;E:\Work\Dev\Django\Tutorials\proj0\src\polls\models.py&quot;, line 10, in Question
          question_text = models.CharField(max_length=200)
      File &quot;E:\Work\Dev\VEnvs\py2713x64-django\lib\site-packages\django\db\models\fields\__init__.py&quot;, line 1043, in __init__
          super(CharField, self).__init__(*args, **kwargs)
      File &quot;E:\Work\Dev\VEnvs\py2713x64-django\lib\site-packages\django\db\models\fields\__init__.py&quot;, line 166, in __init__
          self.db_tablespace = db_tablespace or settings.DEFAULT_INDEX_TABLESPACE
      File &quot;E:\Work\Dev\VEnvs\py2713x64-django\lib\site-packages\django\conf\__init__.py&quot;, line 53, in __getattr__
          self._setup(name)
      File &quot;E:\Work\Dev\VEnvs\py2713x64-django\lib\site-packages\django\conf\__init__.py&quot;, line 39, in _setup
          % (desc, ENVIRONMENT_VARIABLE))
      django.core.exceptions.ImproperlyConfigured: Requested setting DEFAULT_INDEX_TABLESPACE, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.
  </code></pre>
  </blockquote>
  <p><strong>Note</strong>: I only added the question to provide an answer that might be useful to someone.</p>