Login

Snippets by audial

Snippet List

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

audial has posted 1 snippet.