Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
evanhitchen123 opened this issue Jan 28, 2024 · 6 comments

Comments

@evanhitchen123
Copy link

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
Copy link
Contributor

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
Copy link
Author

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
Copy link
Contributor

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

Does the context manager or decorator work?

@wilhelmklopp
Copy link
Member

@evanhitchen123 👋

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

Few more questions for you:

  • which operating system and python version are you using?
  • are you running Django in docker?
  • when you make a request to Django with the kolo middleware present and it's frozen up, what happens? Does the request time out?

@evanhitchen123
Copy link
Author

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
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants