ats-min.com

Just another programmer's site

Month: 4月 2015

Linux: File password protection

Using gpg

 http://superuser.com/questions/162624/how-to-password-protect-gzip-files-on-the-command-line

Python: password generator

Password generator for myself(works in python3).

 

Python: General decorator

General decorator, that can be used to class method and function (keyword args are also permitted) by checking whether args[0] is ‘self’ or not and kwargs.

http://stackoverflow.com/questions/3564049/decorator-changing-function-status-from-method-to-function

Django: csrf_exempt of class based view

To suppress csrf verification of class based view, @csrf_exempt decorator in veiws.py doesn’t work in Django 1.4 .

http://stackoverflow.com/questions/10252238/csrf-exempt-stopped-working-in-django-1-4#comment13230749_10252521

Instead, decorating the as_view function in urls.py works fine!

 

© 2018 ats-min.com

Theme by Anders NorenUp ↑