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.
You should use the right path of your project in settings.py
GRAPHENE = {
'SCHEMA': 'django_root.schema.schema' # change your path
}
Where path.schema.schema is the location of the Schema object in your Django project.
'SCHEMA': 'addyourappnamehere.schema.schema',
faced the same error this worked i added the app name eg:
'SCHEMA': 'auth.schema.schema',
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With