Snippet List
Obfuscate javascript strings.
* Convert
* `{{'Pita Hummus'|js_obfuscate_string}}`
* to something like
* `'P4itzga Hnumg7mubs'.replace(/[4zgn7b]/g,'')`
Making it hard to text-search for strings in your code.
To put obfuscated primary keys in any class, simply inherit from this one. For example:
class Offer(ObfuscatedPKModel)
You can match for these bigint primary keys in your urls.py like this:
'^offer/(?P<offer_pk>[0-9\-]+)$'
- models
- model
- random
- abstract
- primary-key
- obfuscation
- obfuscated
- ID
An email address obfuscation template filter based on the ROT13 Encryption function in Textmate's HTML bundle.
The filter should be applied to a string representing an email address. You can optionally pass the filter an argument that will be used as the email link text (otherwise it will simply use the email address itself).
Example usage:
{{ email_address|obfuscate:"Contact me!" }}
or
{{ email_address|obfuscate }}
Of course, you can also use this on hardcoded email addresses, like this:
{{ "[email protected]"|obfuscate }}
- filter
- javascript
- email
- textmate
- obfuscation
- rot13
4 snippets posted so far.