Django 1.10 AppRegistryNotReady: Apps aren't loaded yet. I can't use django.setup
<p>I'm facing an issue since I upgraded my django from <code>1.7.10</code> to <code>1.10.1</code>.
Indeed, I had the 
<code>django.core.exceptions.ImproperlyConfigured: The SECRET_KEY setting must not be empty.</code>
Error and in order to solve that I figured out that I had to remove django.setup() in order to solve the circular dependency (I assume).
But then, I'm facing the error from the title:</p>

<p>``` </p>

<pre><code>Traceback (most recent call last):
  File "/var/www/webapps/lib/python3.4/site-packages/django/utils/autoreload.py", line 226, in wrapper
    fn(*args, **kwargs)
  File "/var/www/webapps/lib/python3.4/site-packages/django/core/management/commands/runserver.py", line 113, in inner_run
    autoreload.raise_last_exception()
  File "/var/www/webapps/lib/python3.4/site-packages/django/utils/autoreload.py", line 249, in raise_last_exception
    six.reraise(*_exception)
  File "/var/www/webapps/lib/python3.4/site-packages/django/utils/six.py", line 685, in reraise
    raise value.with_traceback(tb)
  File "/var/www/webapps/lib/python3.4/site-packages/django/utils/autoreload.py", line 226, in wrapper
    fn(*args, **kwargs)
  File "/var/www/webapps/lib/python3.4/site-packages/django/__init__.py", line 27, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/var/www/webapps/lib/python3.4/site-packages/django/apps/registry.py", line 85, in populate
    app_config = AppConfig.create(entry)
  File "/var/www/webapps/lib/python3.4/site-packages/django/apps/config.py", line 90, in create
    module = import_module(entry)
  File "/var/www/webapps/lib/python3.4/importlib/__init__.py", line 109, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "&lt;frozen importlib._bootstrap&gt;", line 2231, in _gcd_import
  File "&lt;frozen importlib._bootstrap&gt;", line 2214, in _find_and_load
  File "&lt;frozen importlib._bootstrap&gt;", line 2203, in _find_and_load_unlocked
  File "&lt;frozen importlib._bootstrap&gt;", line 1200, in _load_unlocked
  File "&lt;frozen importlib._bootstrap&gt;", line 1129, in _exec
  File "&lt;frozen importlib._bootstrap&gt;", line 1448, in exec_module
  File "&lt;frozen importlib._bootstrap&gt;", line 321, in _call_with_frames_removed
  File "/var/www/webapps/lib/python3.4/site-packages/easy_select2/__init__.py", line 7, in &lt;module&gt;
    from easy_select2.utils import (
  File "/var/www/webapps/lib/python3.4/site-packages/easy_select2/utils.py", line 7, in &lt;module&gt;
    from easy_select2.widgets import Select2Mixin, Select2, Select2Multiple
  File "/var/www/webapps/lib/python3.4/site-packages/easy_select2/widgets.py", line 24, in &lt;module&gt;
    static('easy_select2/js/init.js'),
  File "/var/www/webapps/lib/python3.4/site-packages/django/templatetags/static.py", line 163, in static
    return StaticNode.handle_simple(path)
  File "/var/www/webapps/lib/python3.4/site-packages/django/templatetags/static.py", line 112, in handle_simple
    if apps.is_installed('django.contrib.staticfiles'):
  File "/var/www/webapps/lib/python3.4/site-packages/django/apps/registry.py", line 225, in is_installed
    self.check_apps_ready()
  File "/var/www/webapps/lib/python3.4/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>And the "apps registrations":</p>

<pre><code>    # APP CONFIGURATION
    DJANGO_APPS = (
        # Default Django apps:
        'django.contrib.auth',
        'django.contrib.contenttypes',
        'django.contrib.sessions',
        'django.contrib.sites',
        'django.contrib.sitemaps',
        'django.contrib.staticfiles',
        'django.contrib.messages',
        # Useful template tags:
        # 'django.contrib.humanize',
    )

    THIRD_PARTY_APPS = (
        # Admin
        'djangocms_admin_style',
        'djangocms_text_ckeditor',
        'django.contrib.admin',

        # Django CMS
        'cms',
        'menus',
        'sekizai',
        'treebeard',

        'easy_thumbnails',
        'easy_thumbnails.optimize',
        'filer',
        'rosetta',
        'cmsplugin_filer_file',
        'cmsplugin_filer_folder',
        'cmsplugin_filer_link',
        'cmsplugin_filer_image',
        'cmsplugin_filer_teaser',
        'cmsplugin_filer_video',
        #'cmsplugin_filer_svg',
        # 'djangocms_ckeditor_filer',
        'djangocms_style',
        'djangocms_flash',
        'djangocms_googlemap',
        'djangocms_inherit',

        'reversion',
        'aldryn_reversion',
        'parler',
        'taggit',
        'meta',
        'meta_mixin',
        'cities_light',
        'admin_enhancer',
        'multiselectfield',# multiselect in charfield
        'sortedm2m',# ordered manyTomany
        'easy_select2',
        'taggit_autosuggest_select2',
        'adminsortable2',
        'autocomplete_light',
        'compressor',
        'nocaptcha_recaptcha',
        'widget_tweaks',
        'qartez',
        'django_mobile',
        'cookielaw',
        'django_user_agents',
    )

    # Apps specific for this project go here.
    LOCAL_APPS = (
        'blippar',
        'multisite_multilanguage',
        'djangocms_extend',
        'djangocms_blog',
        'djangocms_showroom',
        'djangocms_press',
        'djangocms_partner_profile',
        'djangocms_faq',
        'djangocms_presentations',
        'djangocms_projects',

        # plugins
        'blippbutton',
        'blippvideo',
        'djangocms_column',
        'djangocms_footer',
        'djangocms_office',
        'djangocms_contact',
        'djangocms_partner',
        'djangocms_job',
        'djangocms_image',
        'djangocms_commons',
        'djangocms_casestudies',
        'djangocms_presentations_cases',
        'djangocms_testimonial',
        # Your stuff: custom apps go here
    )

    # See: https://docs.djangoproject.com/en/dev/ref/settings/#installed-apps
    INSTALLED_APPS = DJANGO_APPS + THIRD_PARTY_APPS + LOCAL_APPS
    # END APP CONFIGURATION
</code></pre>

<p>Which I don't know how to solve now. Does anyone have an idea on it?</p>

<p>You are hitting <a href="https://code.djangoproject.com/ticket/27033" rel="nofollow">this issue</a>. The answer appears to be to upgrade your version of <code>easy_select2</code>.</p>

<p>The issue <a href="https://github.com/asyncee/django-easy-select2/commit/8b9a4f050166" rel="nofollow">is fixed</a> in <code>easy_select2</code> 1.3.2+. Note that the <a href="http://django-easy-select2.readthedocs.io/en/latest/changelog.html" rel="nofollow">changelog</a> says that there are backwards incompatible changes in 1.3.</p>

python django