Skip to content

Instantly share code, notes, and snippets.

@mnazim
mnazim / The Error
Created July 28, 2011 18:00
Fix "can't find easy_install executable [Errno 2]" in virtualenv(see: http://blog.ikraftsoft.com/post/1397277718/fix-cant-find-easy-install-executable-virtualenv)
$ mkvirtualenv test
New python executable in ./bin/python
Installing distribute....................................................................................................................................done.
Complete output from command /home/mir/test/bin/python /home/mir/test/bin/easy_install /usr/share/python-virtualenv/p...ar.gz:
/home/mir/test/bin/python: can't open file '/home/mir/test/bin/easy_install': [Errno 2] No such file or directory
----------------------------------------
Traceback (most recent call last):
File "/usr/bin/virtualenv", line 3, in
virtualenv.main()
File "/usr/lib/pymodules/python2.6/virtualenv.py", line 534, in main
@mnazim
mnazim / active_tag.py
Created July 9, 2011 14:59
(Django) A simple template tag to add an 'active' class to anchor tags
from django import template
from django.core.urlresolvers import reverse
register = template.Library()
@register.simple_tag
def add_active(request, name, by_path=False):
""" Return the string 'active' current request.path is same as name
Keyword aruguments: