Python is one of my most favorite programming languages. As a professional python and django web framework developer this is some of my knowledge.
- A powerset generator in python - How to generate a powerset in a memory effecient way in python using generators
- A proper and simple Django caching middleware that's opt in
- Convert text to Pirate Talk in Python - AAARRR! How to speak like a pirate with python
- Converting a string into a function (or class) object
- Django's cache_page decorator is fatally limited
- Dynamically watching for missing imports with pylint
- Find mistakes in Django i18n templates - I frequently make mistakes when i18n-ing a django website, making loads of little syntax errors, Here's a script to find some of these little mistakes
- How to add a "English (Pirate)" language option on your website - A properly internationalized website or programme can take different languages, this explains how to automatically make a speak like a pirate option to your language choice
- How to find missing _/gettext import statements - Using pylint to find places in your python or django project where you forgot to import django.utils.translation.ugettext
- Lint tool to find non-i18n strings in a django template - Finds text in a Django template that has not been passed through 'trans' or 'blocktrans'. If you are tying to internationalize a django template, this linter is invaluable to make sure you don't miss any bits.
- Manually activating a language to translate to in Django - Temporarily switch the language that django's translation framework uses to a manually choosen one
- Mocking gettext with Django Translations to test that your code is translating - I wanted to test that a function was translating text, however I had no translations done. Django would fall back to english, so I had no way to know if it was translating or not. By hacking the django objects, I was able to mock a translation.
- Pylint plugin to find non-i18n/gettext strings - This is a plugin for pylint, the python static code analyzer (lint) that finds strings that are not passed through _/gettext. Use this checker to find strings which you have forgotten to translate
- Refresh a Django object from the database
- Simple Django Debugger decorator
- Start the python debugger at any line
- What parts of a string don't match a regex? - Finding what part of a string doesn't match a regular expression using python
- i18n django middleware to check for ugettext_lazy strings in byte strings - If you put a ugettext_lazy call into a byte string (as opposed to a unicode string), you get a
string instead.