Introduction to Django Middleware (Django Tutorial) | Part 25

preview_player
Показать описание
Enjoyed my video? Leave a like!
Рекомендации по теме
Комментарии
Автор

Your 4 videos on middleware were excellent. Exactly what I needed. Was able to add this logic into my own project, just jumping into this middle part of your series. Thanks!

usedbandage
Автор

In an English accent, the word "middleware" sounds like it would be a location on Game of Thrones.

OriginalPhil
Автор

Thank you for your amazing videos! I'm in the middle of my graduation work at the university now and it's so easy and interesting thanks to you! Now I even think to work with Django in the future. :)

АлёнаШтрудель
Автор

for those whos using django 2.2 above


#middleware.py


class
def __init__(self, get_response):
self.get_response = get_response
pass

def __call__(self, request):
response = self.get_response(request)

return response

namesarefools
Автор

where can i find the next part of this video

murshidhaniffa
Автор

thank you. first clear explanation i see

cristobalvargas
Автор

Hi Max!
I downloaded the final code from your github, but when I want to run it I get this error:
File "C:\Users\HOME1\AppData\Local\Programs\Python\Python36\lib\site-packages\django\conf\__init__.py", line 129, in __init__
raise ImproperlyConfigured("The SECRET_KEY setting must not be empty.")
The SECRET_KEY setting must not be empty.

Of course there is a SECRET_KEY in your settings.py, I just don't understand why it is not running for me.
I'm using Python 3.6.1 with
>>> django.VERSION
(1, 11, 1, 'final', 0)

btw great videos, keep up the good work! : )

josephturi
Автор

Hello, Max and folks!
I have got below error and I need you help:

TypeError at /
'LoginRequiredMiddleware' object is not callable

I have searched in Internet and in StackOverflow in one place it says that you should specify the full path. I did everything but still the error is not rectified.

Looking to hearing from you! Thanks in advance!

saidmamadgulomshoev
Автор

On creating LoginRequiredMiddleware and adding settings.py when i am running project i am getting error on the webpage as A server error occurred please contact the administrator please help me to resolve this error out

utkarshshukla
Автор

Hello Max,
class LoginRequiredMiddleware:
def __init__(self):
pass
gives no error, when I add get_response, I receive
TypeError: __init__() takes exactly 2 arguments (1 given)
Python 2.7.13
Django 1.11.1
Thank you

edo
Автор

Nice video, even tho I needed to set speed on 1.5 to enjoy it. Thanks.

besllu
Автор

Not all methods in a class take self, it can take cls if its a class method

chuckynorris
welcome to shbcf.ru