even easier:
import sys, os if os.path.splitext(os.path.basename(sys.argv[0]))[0] == 'pydoc': import django django.setup()
Back to blog or home page
last updated 2016-10-19 16:58:02. served from tektonic.jcomeau.com