Configuring Django on Windows WSGI

I try to write a hello world application on Windows. I managed to install the WSGI module for Apache, the script is called, I can do a vanilla python WSGI hello world, but with Django I have configuration issues. I have the following code:

import os
from django.core.wsgi import get_wsgi_application

os.environ['DJANGO_SETTINGS_MODULE'] = 'app.settings'

application = get_wsgi_application()


ALLOWED_HOSTS = ['localhost', '']
SECRET_KEY = '1234'

My problem, that the app/ does not appear to be loaded, neither the app/ I got the error message

django.core.exceptions.ImproperlyConfigured: The included URLconf ‘settings’ does not appear to have any patterns in it. If you see the ‘urlpatterns’ variable with valid patterns in the file then the issue is probably caused by a circular import.

No matter what I do I got the same error message. It does not matter whether I change the name of the settings file in the DJANGO_SETTINGS_MODULE or I remove that line.

What should I do to fix this?

The environment variable does not work, I have no idea why. But loading the settings directly and copying the properties works like a pycharm.

    from django.conf import settings
    from django.core.wsgi import get_wsgi_application
    import app.settings as app_settings
    for key,value in app_settings.__dict__.items():
        setattr(settings, key, value)
    application = get_wsgi_application()

After a server restart the environment variable started to work. I have no idea what’s going on, lol.