diff --git a/graphene_django_hook.py b/graphene_django_hook.py index 785f088..a5d9261 100644 --- a/graphene_django_hook.py +++ b/graphene_django_hook.py @@ -1,6 +1,7 @@ import argparse import shlex import subprocess +from distutils.sysconfig import get_python_lib import sys from typing import Optional from typing import Sequence @@ -37,7 +38,7 @@ def main(argv: Optional[Sequence[str]] = None) -> int: args = parser.parse_args(argv) # TODO: Fix parsing arguments - command = './{} graphql_schema'.format(args.managepy_path or 'manage.py') + command = '{} {} graphql_schema'.format(get_python_lib(), args.managepy_path or 'manage.py') if args.settings is not None: command += ' --settings={}'.format(args.settings)