Problem importing model into consumers.py

You can have the way you want it.
It’s just not as smooth as the default way of doing it.

You can change the ChatConfig class to look like this:

from django.apps import AppConfig

class ChatConfig(AppConfig):
    default_auto_field = 'django.db.models.BigAutoField'
    name = 'apps.chat'  # <--- Here
    # name = 'my_project.apps.chat'  # <-- If that don't work try this

Explanation:
Django uses the name attribute to load your module, so it will need to know where that project lives.
The above solution works, but you’ll need to change this on every new app you create.
And also when you want to use that app on your code, it will have a long import path, like:

from my_project.apps.chat.models import Message

Another way of tackling this is to not change the apps.py but to tell python to look your apps directory for imports as well, this is the sys.path variable. So, one thing that is also common, you’ll see this in the cookiecutter django template, is to add a given path to that variable, on the manage.py file (that’s the main entrypoint for your django project).

# manage.py 
import os
import sys
from pathlib import Path

if __name__ == "__main__":
    os.environ.setdefault("DJANGO_SETTINGS_MODULE", "my_project.settings")

    try:
        from django.core.management import execute_from_command_line
    except ImportError:
        # The above import may fail for some other reason. Ensure that the
        # issue is really that Django is missing to avoid masking other
        # exceptions on Python 2.
        try:
            import django
        except ImportError:
            raise ImportError(
                "Couldn't import Django. Are you sure it's installed and "
                "available on your PYTHONPATH environment variable? Did you "
                "forget to activate a virtual environment?"
            )

        raise

    # This allows easy placement of apps within the interior
    # my_project/apps directory.
    current_path = Path(__file__).parent.resolve()
    sys.path.append(str(current_path / Path("myproject") / "apps"))

    execute_from_command_line(sys.argv)

With this change, you can import your apps, like:

from chat.models import Message

Let me know if you got any of the solutions working.