Login

Tag "hide"

Snippet List

txt2img tag to show on the web text as images

txt2img tag shows on the web text as images, helping to avoid get indexed email address and some other information you don't want to be on search engines. Usage: `{{worker.email|txt2img:18|safe}}`

  • tag
  • text
  • image
  • templatetag
  • hide
  • convert
Read More

Accordion changelist admin

This is adapted from [rodnsi's version](http://djangosnippets.org/snippets/1818/) to work with Django 1.2 (as django.contrib.admin came with jQuery built in as of 1.2).

  • filter
  • hide
  • collapse
  • changelist
  • list_filter
  • accordion
  • collapsible
Read More
Author: djm
  • 2
  • 3

Hide Emails

Example Usage in the template: <p>{{ email|hide_email }}<br /> {{ email|hide_email:"Contact Me" }}<br /> {% hide_email "[email protected]" %}<br /> {% hide_email "[email protected]" "John Smith" %}</p> {{ text_block|hide_all_emails|safe }} All hidden emails are rendered as a hyperlink that is protected by javascript and an email and name that are encoded randomly using a hex digit or a decimal digit for each character. Example of how a protected email is rendered: <noscript>(Javascript must be enabled to see this e-mail address)</noscript> <script type="text/javascript">// <![CDATA[ document.write('<a href="mai'+'lto:&#106;&#x6f;&#x68;&#x6e;&#x40;&#101;&#120;&#97;&#109;&#x70;&#108;&#x65;&#46;&#x63;&#111;&#109;">&#74;&#111;&#104;&#110;&#x20;&#83;&#x6d;&#x69;&#x74;&#104;</a>') // ]]></script>

  • email
  • hide
  • protect
Read More

Obfuscator for django project sources

This script can be useful if you want to obfuscate your django project sources. I use the [pyobfuscate](http://freshmeat.net/projects/pyobfuscate/) tool, a little bit patched, the patch you can get [here](http://farid.adigamov.com/files/pyobfuscate.patch). The patch switchs off the classes and methods obfuscation as they could be imported from other files. The **pyobfuscate** util can obfuscate only one file at once. This script can obfuscate all .py files from the specified path (src_dir), at the end of the obfuscation it compiles them using **compileall** module. Set the **src_dir** and the **dst_dir** variables. Note: remove original **settings.py** and **urls.py** from the **src_dir** cause **pyobfuscate** util raises an error trying to encode them. The decorators are not handled correctly by pyobfuscate tool. I'm using django for about year and i didn't use the decorators except the '@transaction' decorators. I replace them from the sources at the beginning of the obfuscation and put them at their places in encoded file. In case of using other decorators you should make some changes in code ( line # 64 ).

  • obfuscate
  • sources
  • hide
  • obfuscator
Read More

4 snippets posted so far.