You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Maybe we should disable the system checks at the generateproto command like this
classCommand(BaseCommand):
help="Generates proto."# disable system checks and migration checksrequires_system_checks= []
requires_migrations_checks= []
Or document the usage of generateproto --skip-checks for skipping database connection
What do you think?
Error log
...
Traceback (most recent call last):
File "/code/manage.py", line 30, in <module>
main()
File "/code/manage.py", line 26, in main
management.execute_from_command_line(sys.argv)
File "/usr/local/lib/python3.12/site-packages/django/core/management/__init__.py", line 442, in execute_from_command_line
utility.execute()
File "/usr/local/lib/python3.12/site-packages/django/core/management/__init__.py", line 436, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/lib/python3.12/site-packages/django/core/management/base.py", line 412, in run_from_argv
self.execute(*args, **cmd_options)
File "/usr/local/lib/python3.12/site-packages/django/core/management/base.py", line 453, in execute
self.check()
File "/usr/local/lib/python3.12/site-packages/django/core/management/base.py", line 485, in check
all_issues = checks.run_checks(
^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/django/core/checks/registry.py", line 88, in run_checks
new_errors = check(app_configs=app_configs, databases=databases)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
django.db.utils.OperationalError: connection to server at "localhost" (::1), port 5432 failed: Connection refused
Is the server running on that host and accepting TCP/IP connections?
connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused
Is the server running on that host and accepting TCP/IP connections?
The text was updated successfully, but these errors were encountered:
I understand the need. I am afraid that disabling all system check before runing the command may lead other developers to false issue when using generateproto commands (eg: just change some code that make a check crash but want to generate the proto before runing the server)
Also --skip-checks sound perfect for that. I don't see any reason to not use it if needed.
Scenario
I want to generate protobuf using
python manage.py generateproto
command using a docker imageIt will attempt to connect to the database, as this is the default behavior of the Django command. An section of error log is attached below.
To my understanding, generating the protobuf files doesn't require actual database connection, add a
--skip-checks
to the command and it will workProposal
Maybe we should disable the system checks at the
generateproto
command like thisOr document the usage of
generateproto --skip-checks
for skipping database connectionWhat do you think?
Error log
The text was updated successfully, but these errors were encountered: