AppRegistryNotReady: Apps aren't loaded yet. Django
<p>I'm trying to run django 1.9 on google app engine. Got the below error when trying to access API's through Google API Explorer.</p>

<pre><code>Traceback (most recent call last):
  File "/home/gemini/softwares/google_appengine/google/appengine/runtime/wsgi.py", line 240, in Handle
    handler = _config_handle.add_wsgi_middleware(self._LoadHandler())
  File "/home/gemini/softwares/google_appengine/google/appengine/runtime/wsgi.py", line 299, in _LoadHandler
    handler, path, err = LoadObject(self._handler)
  File "/home/gemini/softwares/google_appengine/google/appengine/runtime/wsgi.py", line 96, in LoadObject
    __import__(cumulative_path)
  File "/home/gemini/projects/cityguide-backend/src/cityguide/api/services.py", line 9, in &lt;module&gt;
    from cityguide.api.internal.categories import Categories
  File "/home/gemini/projects/cityguide-backend/src/cityguide/api/internal/categories.py", line 10, in &lt;module&gt;
    from cityguide.models import Category
  File "/home/gemini/projects/cityguide-backend/src/cityguide/models.py", line 8, in &lt;module&gt;
    class ContactDetails(models.Model):
  File "/home/gemini/projects/cityguide-backend/src/lib/django/db/models/base.py", line 94, in __new__
    app_config = apps.get_containing_app_config(module)
  File "/home/gemini/projects/cityguide-backend/src/lib/django/apps/registry.py", line 239, in get_containing_app_config
    self.check_apps_ready()
  File "/home/gemini/projects/cityguide-backend/src/lib/django/apps/registry.py", line 124, in check_apps_ready
    raise AppRegistryNotReady("Apps aren't loaded yet.")
AppRegistryNotReady: Apps aren't loaded yet.
</code></pre>

<p>I already added </p>

<pre><code>builtins:
- deferred: on
- remote_api: on
- django_wsgi: on

handlers:
 - url: .*
   script: mysite.wsgi.application

env_variables:
  DJANGO_SETTINGS_MODULE: 'mysite.settings'
</code></pre>

<p>inside <code>app.yaml</code> file.</p>

<p><code>wsgi.py</code> looks like</p>

<pre><code>import os

from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "mysite.settings")

application = get_wsgi_application()
</code></pre>

<p>I tried adding <code>django.setup()</code> line on the top of <code>models.py</code> but it shows a different error.</p>

<pre><code>ERROR    2016-02-01 10:03:02,918 wsgi.py:263] 
Traceback (most recent call last):
  File "/home/gemini/softwares/google_appengine/google/appengine/runtime/wsgi.py", line 240, in Handle
    handler = _config_handle.add_wsgi_middleware(self._LoadHandler())
  File "/home/gemini/softwares/google_appengine/google/appengine/runtime/wsgi.py", line 299, in _LoadHandler
    handler, path, err = LoadObject(self._handler)
  File "/home/gemini/softwares/google_appengine/google/appengine/runtime/wsgi.py", line 96, in LoadObject
    __import__(cumulative_path)
  File "/home/gemini/projects/cityguide-backend/src/cityguide/api/services.py", line 9, in &lt;module&gt;
    from cityguide.api.internal.categories import Categories
  File "/home/gemini/projects/cityguide-backend/src/cityguide/api/internal/categories.py", line 10, in &lt;module&gt;
    from cityguide.models import Category
  File "/home/gemini/projects/cityguide-backend/src/cityguide/models.py", line 6, in &lt;module&gt;
    django.setup()
  File "/home/gemini/projects/cityguide-backend/src/lib/django/__init__.py", line 18, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/home/gemini/projects/cityguide-backend/src/lib/django/apps/registry.py", line 115, in populate
    app_config.ready()
  File "/home/gemini/projects/cityguide-backend/src/lib/django/contrib/admin/apps.py", line 22, in ready
    self.module.autodiscover()
  File "/home/gemini/projects/cityguide-backend/src/lib/django/contrib/admin/__init__.py", line 26, in autodiscover
    autodiscover_modules('admin', register_to=site)
  File "/home/gemini/projects/cityguide-backend/src/lib/django/utils/module_loading.py", line 50, in autodiscover_modules
    import_module('%s.%s' % (app_config.name, module_to_search))
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/home/gemini/projects/cityguide-backend/src/cityguide/admin.py", line 2, in &lt;module&gt;
    from cityguide.models import Category
ImportError: cannot import name Category
ERROR    2016-02-01 10:03:02,919 wsgi.py:263] 
Traceback (most recent call last):
  File "/home/gemini/softwares/google_appengine/google/appengine/runtime/wsgi.py", line 240, in Handle
    handler = _config_handle.add_wsgi_middleware(self._LoadHandler())
  File "/home/gemini/softwares/google_appengine/google/appengine/runtime/wsgi.py", line 299, in _LoadHandler
    handler, path, err = LoadObject(self._handler)
  File "/home/gemini/softwares/google_appengine/google/appengine/runtime/wsgi.py", line 96, in LoadObject
    __import__(cumulative_path)
  File "/home/gemini/projects/cityguide-backend/src/cityguide/api/services.py", line 9, in &lt;module&gt;
    from cityguide.api.internal.categories import Categories
  File "/home/gemini/projects/cityguide-backend/src/cityguide/api/internal/categories.py", line 10, in &lt;module&gt;
INFO     2016-02-01 10:03:03,000 module.py:794] default: "POST /_ah/spi/BackendService.getApiConfigs HTTP/1.1" 500 -
    from cityguide.models import Category
INFO     2016-02-01 10:03:03,001 module.py:794] default: "POST /_ah/spi/BackendService.getApiConfigs HTTP/1.1" 500 -
  File "/home/gemini/projects/cityguide-backend/src/cityguide/models.py", line 6, in &lt;module&gt;
INFO     2016-02-01 10:03:03,001 module.py:794] default: "GET /_ah/api/discovery/v1/apis HTTP/1.1" 500 60
    django.setup()
INFO     2016-02-01 10:03:03,001 module.py:794] default: "GET /_ah/api/discovery/v1/apis HTTP/1.1" 500 60
  File "/home/gemini/projects/cityguide-backend/src/lib/django/__init__.py", line 18, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/home/gemini/projects/cityguide-backend/src/lib/django/apps/registry.py", line 78, in populate
    raise RuntimeError("populate() isn't reentrant")
RuntimeError: populate() isn't reentrant
</code></pre>

<p><strong>Temporary solution for this problem:</strong></p>

<p>Seems like I need to open the home page first. So that it would loads the db since I made the homepage to return all the db table contents . Once the db lists  shown on the home page, we are ready to call the Google API Explorer.</p>

<p>Is there any way to refine this solution?</p>