Closed lahirujayathilake closed 1 year ago
Hello @lahirujayathilake The published doc was not up to date because of mkdocs font rgpd policy. Just upgraded my mkdocs policy and published the latest change. You should have a complete quickstart on https://socotecio.github.io/django-socio-grpc/#quickstart
I close this issue. If you face other problem do not hesitate to ask us.
Thanks, @AMontagu for the update. Yes, it solved that issue however, I'm getting the following error when python manage.py generateproto
is executed
File "<project-url>/tutorial/venv/lib/python3.10/site-packages/lark/lexer.py", line 478, in lex
yield lexer.next_token(lexer_state, parser_state)
File "<project-url>/tutorial/venv/lib/python3.10/site-packages/lark/lexer.py", line 398, in next_token
raise UnexpectedCharacters(lex_state.text, line_ctr.char_pos, line_ctr.line, line_ctr.column,
lark.exceptions.UnexpectedCharacters: No terminal matches 'q' in the current parser context, at line 4 col 19
optional string question_text = 1;
^
Expected one of:
* EQUAL
Previous tokens: Token('FIELDNAME', 'string')
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<project-url>/tutorial/manage.py", line 22, in <module>
main()
File "<project-url>/tutorial/manage.py", line 18, in main
execute_from_command_line(sys.argv)
File "<project-url>/tutorial/venv/lib/python3.10/site-packages/django/core/management/__init__.py", line 446, in execute_from_command_line
utility.execute()
File "<project-url>/tutorial/venv/lib/python3.10/site-packages/django/core/management/__init__.py", line 440, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "<project-url>/tutorial/venv/lib/python3.10/site-packages/django/core/management/base.py", line 402, in run_from_argv
self.execute(*args, **cmd_options)
File "<project-url>/tutorial/venv/lib/python3.10/site-packages/django/core/management/base.py", line 448, in execute
output = self.handle(*args, **options)
File "<project-url>/tutorial/venv/lib/python3.10/site-packages/django_socio_grpc/management/commands/generateproto.py", line 80, in handle
protos_by_app = generator.get_protos_by_app()
File "<project-url>/tutorial/venv/lib/python3.10/site-packages/django_socio_grpc/protobuf/generators.py", line 45, in get_protos_by_app
self.current_existing_proto_data = self.parse_existing_proto_file(
File "<project-url>/tutorial/venv/lib/python3.10/site-packages/django_socio_grpc/protobuf/generators.py", line 201, in parse_existing_proto_file
proto_data = protoparser.serialize2json_from_file(existing_proto_path)
File "<project-url>/tutorial/venv/lib/python3.10/site-packages/protoparser/parser.py", line 362, in serialize2json_from_file
return json.dumps(_recursive_to_dict(parse(data)))
File "<project-url>/tutorial/venv/lib/python3.10/site-packages/protoparser/parser.py", line 322, in parse
tree = parser.parse(data)
File "<project-url>/tutorial/venv/lib/python3.10/site-packages/lark/lark.py", line 581, in parse
return self.parser.parse(text, start=start, on_error=on_error)
File "<project-url>/tutorial/venv/lib/python3.10/site-packages/lark/parser_frontends.py", line 106, in parse
return self.parser.parse(stream, chosen_start, **kw)
File "<project-url>/tutorial/venv/lib/python3.10/site-packages/lark/parsers/lalr_parser.py", line 41, in parse
return self.parser.parse(lexer, start)
File "<project-url>/tutorial/venv/lib/python3.10/site-packages/lark/parsers/lalr_parser.py", line 171, in parse
return self.parse_from_state(parser_state)
File "<project-url>/tutorial/venv/lib/python3.10/site-packages/lark/parsers/lalr_parser.py", line 188, in parse_from_state
raise e
File "<project-url>/tutorial/venv/lib/python3.10/site-packages/lark/parsers/lalr_parser.py", line 178, in parse_from_state
for token in state.lexer.lex(state):
File "<project-url>/tutorial/venv/lib/python3.10/site-packages/lark/lexer.py", line 487, in lex
raise UnexpectedToken(token, e.allowed, state=parser_state, token_history=[last_token], terminals_by_name=self.root_lexer.terminals_by_name)
lark.exceptions.UnexpectedToken: Unexpected token Token('CONSTANT', 'question_text') at line 4, column 19.
Expected one of:
* EQUAL
Previous tokens: [Token('FIELDNAME', 'string')]
Is there something I'm missing?
@lahirujayathilake Can you provide a minimal reproduction of this ?
But first you can try to delete all your protofile and try generate again. The rror look like you already have a proto file with a syntax we do not support.
Close due to inactivity
Hi All,
First of all, thank you all for your contributions and for bringing this project alive. I just started using the Project and as instructed I followed the documentation for Quickstart - https://socotecio.github.io/django-socio-grpc/#quickstart
When I follow the steps I'll be getting an error when I try to execute the command,
python manage.py generateproto
This gives the following error,
I saw the django-grpc-framework project (https://github.com/fengsp/django-grpc-framework) mention this in the README.md file.
but this has to have generated stub classes.
Can you guide me on thow to get the quickstart project up and running?