Tag: django
Total 3 Posts
Today I'll tell you how to create custom exception handlers in Django. They are useful, if you want to do custom action when Exception is raised from view. For example, you can create consistent way of handling your own generic exception type. It's very easy, but can be super useful! To show how it's working, we'll create helpful handler that...
If you came here, you probably know what is a context processor, but let's quickly recap. It's a function, that returns dictionary of values. Those values will be injected to rendering context without explicitly defining them in view. They allows us to refactor commonly used variables out of views. The most well-known context processor is Authentication, making it possible to...
If you are programming for some time, you probably heard that sentence: I made that mistake many times - I've spent lot of time optimizing something that was totally irrelevant. Basically, most of the time you should focus to create readable, maintainable code. AND THEN, if something is not fast enough, yo can try to optimize it. But firstly, profile!...