Creatively... Do!
  • Home
  • Blog
  • Contact
  • Programming
    • Solitaire
    • Minesweeper
    • Sudoku
    • Pong
    • Mandelbrot
  • Music
    • The Snowman

Blog

  • Home
  • Blog
  • Category: django

Viewing posts for the category django

User-friendly Django CSRF Protection

Posted by: christian_abbott in django 6 years, 11 months ago

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:

read more / 3 comments

Django logging in version 1.4: How to correctly remove the require_debug_false filter from the mail_admin handler

Posted by: christian_abbott in django 6 years, 11 months ago

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:

read more / 3 comments

Recent Posts

  • Using SVG and CSS to create Pacman (out of pie charts)
  • How to solve the Impossible Escape puzzle with almost no math
  • How to make iterators out of Python functions without using yield
  • How to globally customize exception stack traces in Python
  • Is your tango embrace really too firm or too relaxed?

Archive

2017
  • May (1)
2015
  • February (1)
2013
  • November (1)
  • October (1)
  • March (1)
  • February (3)
  • January (4)
2012
  • December (1)

Categories

  • django (2)
  • environment (1)
  • math (2)
  • python (2)
  • tango (5)
  • web development (1)

Authors

  • christian_abbott (13)

Feeds

RSS / Atom
  • Blog
  • Contact
  • Programming
  • Music
©2012-2017 Christian Abbott