Django : Can't import 'module'. Check that module AppConfig.name is correct : <p>Might look like an already answered question, actually <a href="https://stackoverflow.com/questions/43621259/django-project-restructure-cant-import-app">here</a> you have the same problem (kind of) i had. My problem is, it's just a trick, one line, no explanation (and still it's different but the solution given works, and that's part of my problem).
Here's my project structure, simplified:</p>

<pre><code>manage.py
compfactu/---settings.py
          |--__init__.py
          |--core/--------__init__.py
                         |-apps.py  
</code></pre>

<p>So here is how I added my app in <code>INSTALLED_APPS</code>:</p>

<p><strong>apps.py</strong></p>

<pre><code>from django.apps import AppConfig


class CoreConfig(AppConfig):
    name = 'core'
</code></pre>

<p><strong>settings.py</strong></p>

<pre><code>INSTALLED_APPS = [ 
    ...
    #compfactu modules
    'compfactu.core.apps.CoreConfig',
]
</code></pre>

<p>As I read the django 1.11 documentation, and I quote :</p>

<blockquote>
  <p>New applications should avoid default_app_config. Instead they should require the dotted path to the appropriate AppConfig subclass to be configured explicitly in INSTALLED_APPS.</p>
</blockquote>

<p>Well nice, it's a new application so i should do that : but i'm getting an error. And it's not a problem of pythonpath, cause i just opened a python shell and I can do <code>from compfactu.core.apps import CoreConfig</code> with no problem (print the sys.path too, everything's fine).</p>

<p>But I have this error, here's a full traceback:</p>

<pre><code>Traceback (most recent call last):
  File "/home/jbjaillet/Projets/venvcompfactu/lib/python3.5/site-packages/django/apps/config.py", line 147, in create
    app_module = import_module(app_name)
  File "/home/jbjaillet/Projets/venvcompfactu/lib/python3.5/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "&lt;frozen importlib._bootstrap&gt;", line 986, in _gcd_import
  File "&lt;frozen importlib._bootstrap&gt;", line 969, in _find_and_load
  File "&lt;frozen importlib._bootstrap&gt;", line 956, in _find_and_load_unlocked
ImportError: No module named 'core'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/jbjaillet/Projets/venvcompfactu/lib/python3.5/site-packages/django/utils/autoreload.py", line 228, in wrapper
    fn(*args, **kwargs)
  File "/home/jbjaillet/Projets/venvcompfactu/lib/python3.5/site-packages/django/core/management/commands/runserver.py", line 117, in inner_run
    autoreload.raise_last_exception()
  File "/home/jbjaillet/Projets/venvcompfactu/lib/python3.5/site-packages/django/utils/autoreload.py", line 251, in raise_last_exception
    six.reraise(*_exception)
  File "/home/jbjaillet/Projets/venvcompfactu/lib/python3.5/site-packages/django/utils/six.py", line 685, in reraise
    raise value.with_traceback(tb)
  File "/home/jbjaillet/Projets/venvcompfactu/lib/python3.5/site-packages/django/utils/autoreload.py", line 228, in wrapper
    fn(*args, **kwargs)
  File "/home/jbjaillet/Projets/venvcompfactu/lib/python3.5/site-packages/django/__init__.py", line 27, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/home/jbjaillet/Projets/venvcompfactu/lib/python3.5/site-packages/django/apps/registry.py", line 85, in populate
    app_config = AppConfig.create(entry)
  File "/home/jbjaillet/Projets/venvcompfactu/lib/python3.5/site-packages/django/apps/config.py", line 151, in create
    app_name, mod_path, cls_name,
django.core.exceptions.ImproperlyConfigured: Cannot import 'core'. Check that 'compfactu.core.apps.CoreConfig.name' is correct.
</code></pre>

<p>And from there, all files and class have been generated by django (manage.py startapp).
And when I actually do what's told in the question I linked above, doing like :</p>

<pre><code>INSTALLED_APPS = [ 
    ...
    #compfactu modules
    'compfactu.core',
]
</code></pre>

<p>it works ! And I don't get that point ! Reading the doc (part i've just quoted), it SHOULD NOT work (noting that I don't have a <code>default_app_config</code> in my <code>__init__.py</code>.</p>

<p>So, as the question where I found the "trick" but no explanation, I'm here asking why it works this way when it shouldn't, and why the solution in the official doc doesn't work?</p>

<p>Thank you in advance for you time.</p>
