[Python] Problem importing module for GRAPHENE setting 'SCHEMA' in Django 2.2

Discussão em 'Python' iniciado por Stack, Novembro 28, 2024.

  1. Stack

    Stack Membro Participativo

    I am new to django(installed version 2.2 in my virtualenv) and graphql. I tried to follow the instructions for setting up graphql in django from the following site

    https://docs.graphene-python.org/projects/django/en/latest/installation/

    When I try to run the server with the url http://127.0.0.1:8000/graphql/

    I get the following error.

    ImportError at /graphql/
    Could not import 'django_root.schema.schema' for Graphene setting
    'SCHEMA'. ModuleNotFoundError: No module named 'django_root'.


    I followed the instructions carefully but I am unable to get this right. Please help. I checked similar questions but it didn't help.

    Edit: I tried the following

    'SCHEMA': 'folder_with_setting.py_file.schema.schema'

    'SCHEMA': 'folder_with_manage.py_file.schema.schema'

    'SCHEMA': 'folder_with_manage.py_file.folder_with_settings.py_file.schema.schema'

    'SCHEMA': 'folder_with_manage.py_file/folder_with_settings.py_file.schema.schema'

    and many other combinations. It's not working.

    Continue reading...

Compartilhe esta Página