kolofordjango / kolo

See everything happening in your running Django app. All without leaving VSCode
https://kolo.app
512 stars 14 forks source link

When I add kolo.middleware.KoloMiddleware to the top of my middleware, django wont start up #79

Open evanhitchen123 opened 10 months ago

evanhitchen123 commented 10 months ago
DEBUG = True

MIDDLEWARE = [
    "kolo.middleware.KoloMiddleware",
    "django.middleware.security.SecurityMiddleware",
    "corsheaders.middleware.CorsMiddleware",
    "whitenoise.middleware.WhiteNoiseMiddleware",
    "django.contrib.sessions.middleware.SessionMiddleware",
    "django.middleware.common.CommonMiddleware",
    "django.middleware.csrf.CsrfViewMiddleware",
    "django.contrib.auth.middleware.AuthenticationMiddleware",
    "django.contrib.messages.middleware.MessageMiddleware",
    "django.middleware.clickjacking.XFrameOptionsMiddleware",
]

The following in my settings, then output on console:

Watching for file changes with StatReloader
Watching for file changes with StatReloader
Performing system checks...

System check identified no issues (0 silenced).

However, when I remove kolo middleware, it starts up fine

LilyFoote commented 10 months ago

Interesting. Can you try moving it down through the list to see if it starts working in a different location? Perhaps there's a bad interaction with another middleware.

evanhitchen123 commented 10 months ago
MIDDLEWARE = [
    "django.middleware.security.SecurityMiddleware",
    "corsheaders.middleware.CorsMiddleware",
    "whitenoise.middleware.WhiteNoiseMiddleware",
    "django.contrib.sessions.middleware.SessionMiddleware",
    "django.middleware.common.CommonMiddleware",
    "django.middleware.csrf.CsrfViewMiddleware",
    "django.contrib.auth.middleware.AuthenticationMiddleware",
    "django.contrib.messages.middleware.MessageMiddleware",
    "django.middleware.clickjacking.XFrameOptionsMiddleware",
    "kolo.middleware.KoloMiddleware",
]

all my middleware and even at the bottom it freezes up

LilyFoote commented 10 months ago

What are you running at the console? python manage.py runserver?

Does the context manager or decorator work?

wilhelmklopp commented 10 months ago

@evanhitchen123 👋

Yeah super strange, haven't seen this before either!

Few more questions for you:

evanhitchen123 commented 10 months ago

Ok so have solved this, not sure exactly why but for whatever reason, changing the name of my sqllite db resulted in it starting up eventually. I had been trying to get this to work with my docker arrangement but that will be my next step.

LilyFoote commented 10 months ago

That is strange. I'd love to understand why that helped!