Questions tagged [django-middleware]

Middleware is a framework of hooks into Django’s request/response processing. It’s a light, low-level “plugin” system for globally altering Django’s input and/or output.

Middleware is a framework of hooks into Django’s request/response processing. It’s a light, low-level “plugin” system for globally altering Django’s input and/or output. Each middleware component is responsible for doing some specific function.

Django ships with some built-in middleware you can use right out of the box; they’re documented in the built-in middleware reference.

455 questions
0
votes
2 answers

Display the same 'session', turn-based django game

I really dont know if this kind of diffuse question is suited here, but i'll give it a go anyhow. I'm building a turn-based (Yatzee)game in Django, where i have a rally simple model for the user/player and a bit more complex one for each users…
BSG
  • 1,382
  • 4
  • 14
  • 25
0
votes
1 answer

Counting fully rendered requests

I am not new to Django (1y work experience) but I have got a strange task that I cannot deal with. So I have to write to write Middleware that will be counting requests, but only those that were not aborted by client (the ones that got fully…
Piotr Jaszkowski
  • 1,150
  • 9
  • 12
0
votes
1 answer

Why is writing my own MiddleWare crashing my Django application?

I want to run a function before any view in my app is loaded, so I wrote my own middleware. It is in a file called "DoBeforeMiddleWare.py" located in the folder "my_app_name" and, for now, looks like class DoBeforeMiddleWare: def…
dangerChihuahua007
  • 20,299
  • 35
  • 117
  • 206
-1
votes
1 answer

Django - middleware inserting code in template

I need middleware just like contib.messages, but to insert specific JS code to page from views instead of message. Is there a ready-made solutions or any ideas how to do this?
-1
votes
1 answer

Middlware triggering error twice in django

I've got some middleware I created for an app that checks a few criteria against a logged in user. If it fails any of those, it kicks off errors letting the user know. The problem is that the error is showing up twice at the top of the page. The…
Hanny
  • 2,078
  • 6
  • 24
  • 52
1 2 3
30
31