Django doesn't register core module from different but same level submodules

Hello, in my Django project, I want to reference my core module when importing settings variables.

Here is my project structure:

When I reference core module from the admin folder, everything works fine. I can do this for example:

from django.contrib import admin
from core.models import Configuration

@admin.register(Configuration)
class ConfigurationAdmin(admin.ModelAdmin):
    list_display = ['key', 'value']
    fields = ['key', 'value']

But when I try to reference core module from the rvo folder, I get this error:

I have init.py files everywhere but Django just seems to ignore the core module from the rvo folder. Where am I going wrong? Thank you for your help

Based on what I can see from the image, I don’t see a settings.py file in core. It looks to me in the picture that it’s in the rvo directory.

No settings.py is in the core directory. You can see a line next to the rvo directory which is opened. Also the files in the rvo are little bit intented from the files below.

Sorry, those images are difficult for me to read.

It kinda looks like you’re trying to run your rwo_client.py code directly?

If this is a Django module, or part of some code that you’re trying to run within a Django context, you can’t run it directly like this.

What is this code in relation to Django? Is it something being used in a view or by some other Django component? Or is this a program intended to be run outside the context of a Django environment?

1 Like