Viewing posts from January, 2013
Functions are easily thought of as a way of matching up numbers from one set with numbers of another. The function f(x) = x+3, for example, is just a way of saying that I'm matching up the number 1 with the number 4, the number 2 with the number 5, etc. A different example would be the absolute value function which matches both -4 and +4 to the number +4. Think of functions as matchmakers.
The fact that Django comes with CSRF protection is extremely nice. Unless, of course, your hobby is exploiting websites, in which case get off my site. For the rest of us, thwart those baddies by using Django's
CsrfViewMiddleware and the
csrf_token tag. But when you do, keep in mind what that changes on your webpages. The
csrf_token tag sets a cookie. So, that begs the question:
There you are, configuring some shiny new django website of yours, and you want to test some of the logging features. And because you're testing in a development environment, you have DEBUG=True in your settings.py file. But the problem is, you're not seeing the admin logging emails you are expecting. So, you check the LOGGING variable in settings.py to see if you missed something. It looks something like this by default:
"Close embrace is impossible. I'm sticking to open."