title: django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet launching debug on pycharm
body: <p>I've a Django (version 1.9) application running with python 2.7.10 and i'm using Virtualenv.
  Running the application with <code>./manage.py runserver</code> i've no error, but when i try to run in debug i got <code>django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet.</code> </p>
  
  <p>Here it is the pycharm debugging configuration:</p>
  
  <p><a href="https://i.stack.imgur.com/4V5nr.png" rel="noreferrer"><img src="https://i.stack.imgur.com/4V5nr.png" alt="enter image description here"></a>
  Any idea why? 
  Here the complete stacktrace:</p>
  
  <pre><code>   /Users/matteobetti/Progetti/Enydros/enysoft/bin/python ./manage.py runserver
      Traceback (most recent call last):
        File "./manage.py", line 10, in &lt;module&gt;
          execute_from_command_line(sys.argv)
        File "/Users/matteobetti/Progetti/Enydros/enysoft/lib/python2.7/site-packages/django/core/management/__init__.py", line 350, in execute_from_command_line
          utility.execute()
        File "/Users/matteobetti/Progetti/Enydros/enysoft/lib/python2.7/site-packages/django/core/management/__init__.py", line 342, in execute
          self.fetch_command(subcommand).run_from_argv(self.argv)
        File "/Users/matteobetti/Progetti/Enydros/enysoft/lib/python2.7/site-packages/django/core/management/__init__.py", line 176, in fetch_command
          commands = get_commands()
        File "/Users/matteobetti/Progetti/Enydros/enysoft/lib/python2.7/site-packages/django/utils/lru_cache.py", line 100, in wrapper
          result = user_function(*args, **kwds)
        File "/Users/matteobetti/Progetti/Enydros/enysoft/lib/python2.7/site-packages/django/core/management/__init__.py", line 71, in get_commands
          for app_config in reversed(list(apps.get_app_configs())):
        File "/Users/matteobetti/Progetti/Enydros/enysoft/lib/python2.7/site-packages/django/apps/registry.py", line 137, in get_app_configs
          self.check_apps_ready()
        File "/Users/matteobetti/Progetti/Enydros/enysoft/lib/python2.7/site-packages/django/apps/registry.py", line 124, in check_apps_ready
          raise AppRegistryNotReady("Apps aren't loaded yet.")
      django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet.
  </code></pre>
  
  <p>i add <code>import django</code> e <code>django.setup</code> before <code>execute_from_command_line(sys.argvs)</code></p>
  
  <p>and i get this stacktrace: </p>
  
  <pre><code>Traceback (most recent call last):
    File "/Users/matteobetti/Progetti/Enydros/enysoft/manage.py", line 10, in &lt;module&gt;
      django.setup()
    File "/Users/matteobetti/Progetti/Enydros/enysoft/lib/python2.7/site-packages/django/__init__.py", line 18, in setup
      apps.populate(settings.INSTALLED_APPS)
    File "/Users/matteobetti/Progetti/Enydros/enysoft/lib/python2.7/site-packages/django/apps/registry.py", line 85, in populate
      app_config = AppConfig.create(entry)
    File "/Users/matteobetti/Progetti/Enydros/enysoft/lib/python2.7/site-packages/django/apps/config.py", line 90, in create
      module = import_module(entry)
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/__init__.py", line 37, in import_module
      __import__(name)
    File "/Users/matteobetti/Progetti/Enydros/enysoft/frontend/apps.py", line 2, in &lt;module&gt;
      from frontend.services.container import app_context
    File "/Users/matteobetti/Progetti/Enydros/enysoft/frontend/services/container.py", line 1, in &lt;module&gt;
      from frontend.services.enysoft_services import RService, FixedSizeDirectoryCache, TubeSectionService, CsvSanifier
    File "/Users/matteobetti/Progetti/Enydros/enysoft/frontend/services/enysoft_services.py", line 5, in &lt;module&gt;
      import rpy2.robjects as ro
    File "/Users/matteobetti/Progetti/Enydros/enysoft/lib/python2.7/site-packages/rpy2/robjects/__init__.py", line 15, in &lt;module&gt;
      import rpy2.rinterface as rinterface
    File "/Users/matteobetti/Progetti/Enydros/enysoft/lib/python2.7/site-packages/rpy2/rinterface/__init__.py", line 16, in &lt;module&gt;
      tmp = subprocess.check_output(("R", "RHOME"), universal_newlines=True)
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 566, in check_output
      process = Popen(stdout=PIPE, *popenargs, **kwargs)
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 710, in __init__
      errread, errwrite)
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1335, in _execute_child
      raise child_exception
  OSError: [Errno 2] No such file or directory
  </code></pre>
  
  <p>Another things to say is that my collegue with linux have no problem with the same virtualenv configuration, the only one that have problem is i, using mac Os. </p>