Skip to content

SyntaxError When Trying to Run Django Project with Graphene #1448

@faresemad

Description

@faresemad

Hello,

I am currently working on a large Django project that utilizes the Graphene framework to implement GraphQL in the application. I've encountered an issue while attempting to run the project, where a SyntaxError is raised, pointing to the graphene_django/__init__.py file on line 1.
Error message:

SyntaxError: invalid syntax
File "/media/fares/01D884D05EFC32C0/Projects When Learn/GraphQl/graphql/books/urls.py", line 3, in <module>
from graphene_django.views import GraphQLView
File "/media/fares/01D884D05EFC32C0/Projects When Learn/GraphQl/graphql/.venv/lib/python3.11/site-packages/graphene_django/__init__.py", line 1
xfrom .fields import DjangoConnectionField, DjangoListField

Upon investigating the issue, I noticed that there is a mistake in the import statement in the graphene_django/__init__.py file on the first line. An extra "x" character was mistakenly included at the beginning of the line.
Screenshot from 2023-08-09 21-29-43

The correct import should be as follows:

from .fields import DjangoConnectionField, DjangoListField

Please review your imports in this file and related files to ensure proper syntax.

I hope this information proves helpful, and feel free to reach out if you need further assistance or have additional questions.

Thank you very much!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions