Writing Maintenance Mode Middleware in Django (with tests)!

preview_player
Показать описание
In this video, we'll learn how to write a custom middleware that allows us to put our Django app into Maintenance Mode.

We'll also write Django Tests for the functionality provided by the middleware class!

☕️ 𝗕𝘂𝘆 𝗺𝗲 𝗮 𝗰𝗼𝗳𝗳𝗲𝗲:
To support the channel and encourage new videos, please consider buying me a coffee here:

📌 𝗖𝗵𝗮𝗽𝘁𝗲𝗿𝘀:
00:00 Intro
00:34 Django Middleware overview
03:59 Defining Maintenance Mode middleware
10:29 Add Django tests for middleware

𝗦𝗼𝗰𝗶𝗮𝗹 𝗠𝗲𝗱𝗶𝗮:

📚 𝗙𝘂𝗿𝘁𝗵𝗲𝗿 𝗿𝗲𝗮𝗱𝗶𝗻𝗴 𝗮𝗻𝗱 𝗶𝗻𝗳𝗼𝗿𝗺𝗮𝘁𝗶𝗼𝗻:

#python #django #webdevelopment
Рекомендации по теме
Комментарии
Автор

Excellent tute as usual. If you could look into manually rendering inlineformsets with <table>, that would be a hit.

kimuyu
Автор

Good job. You could add also pytest example..

hipertracker
Автор

Thanks a lot for this great Django course 🤩. Please make a video about async ORM and async views in Django, and how we should integrate Django ORM with our views and when we should use it. This is content that I don't see any good sources for.

aminzahedsadeghi
Автор

Check this video to learn how to re-write these tests with Pytest!

bugbytes
Автор

1:31 Could we do some vids on strategies for updating data of a production site? How best do we change a large portion of our data (80%) without affecting performance?

Septumsempra
Автор

Another amazing video!
When checking if a variable has been set in settings, do you usually use if settings.MAINTENANCE_MODE or if hasattr(settings, 'MAINTENANCE_MODE ') and settings.MAINTENANCE_MODE is not None? Which is best practice to use?

Peterstavrou
Автор

This is really informative. Thanks for sharing.

AmoahDevLabs
Автор

Great vid, thanks! I would also love a video about both using and creating webhooks...

francoisschoeman
Автор

Make video about integrating django with ML

estersone
Автор

When you doing a video on `django-components`?

_russell
Автор

Would it be possible to do this without restarting the server? For example reading the value from cache in the middleware or at this point it's just easier to do it with nginx or something. Very cool video gave me tons of ideas to test out myself. :) much love

TheNerdyPlayer