import sys, os local_path = lambda path: os.path.join(os.path.dirname(__file__), path) os.environ['DJANGO_SETTINGS_MODULE'] = 'PROJECTNAME.settings' sys.path.append(local_path('..')) ... # Rest of conf.py goes here def setup(app): from django_sphinx import process_docstring # Register the docstring processor with sphinx app.connect('autodoc-process-docstring', process_docstring)