-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Add django-prodserver as a dependency #6186
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Add django-prodserver as a dependency #6186
Conversation
16b8d21 to
6103b4a
Compare
| worker: REMAP_SIGTERM=SIGQUIT python manage.py prodserver worker | ||
| beat: REMAP_SIGTERM=SIGQUIT python manage.py prodserver beat |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried to deploy that to heroku and I'm getting some errors (Sentry public link)
Logs
Worker process:
heroku/worker.1 Starting process with command `REMAP_SIGTERM=SIGQUIT python manage.py prodserver worker`
heroku/worker.1 State changed from starting to up
app/worker.1 Starting server named worker
app/worker.1 Traceback (most recent call last):
app/worker.1 File "/app/manage.py", line 30, in <module>
app/worker.1 main()
app/worker.1 ~~~~^^
app/worker.1 File "/app/manage.py", line 26, in main
app/worker.1 execute_from_command_line(sys.argv)
app/worker.1 ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^
app/worker.1 File "/app/.heroku/python/lib/python3.13/site-packages/django/core/management/__init__.py", line 442, in execute_from_command_line
app/worker.1 utility.execute()
app/worker.1 ~~~~~~~~~~~~~~~^^
app/worker.1 File "/app/.heroku/python/lib/python3.13/site-packages/django/core/management/__init__.py", line 436, in execute
app/worker.1 self.fetch_command(subcommand).run_from_argv(self.argv)
app/worker.1 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
app/worker.1 File "/app/.heroku/python/lib/python3.13/site-packages/django_prodserver/management/commands/prodserver.py", line 64, in run_from_argv
app/worker.1 self.start_server(*args, **cmd_options)
app/worker.1 ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
app/worker.1 File "/app/.heroku/python/lib/python3.13/site-packages/django_prodserver/management/commands/prodserver.py", line 102, in start_server
app/worker.1 backend.start_server(*backend.prep_server_args())
app/worker.1 ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/worker.1 File "/app/.heroku/python/lib/python3.13/site-packages/django_prodserver/backends/celery.py", line 18, in start_server
app/worker.1 self.app.Worker(*args).start()
app/worker.1 ~~~~~~~~~~~~~~~^^^^^^^
app/worker.1 File "/app/.heroku/python/lib/python3.13/site-packages/celery/worker/worker.py", line 94, in __init__
app/worker.1 self.app.loader.init_worker()
app/worker.1 ^^^^^^^^^^^^^^^
app/worker.1 AttributeError: 'str' object has no attribute 'loader'. Did you mean: 'lower'?
app/worker.1 Sentry is attempting to send 2 pending events
app/worker.1 Waiting up to 2 seconds
app/worker.1 Press Ctrl-C to quit
heroku/worker.1 State changed from up to crashed
heroku/worker.1 Process exited with status 1
Beat process:
app/beat.1 Starting server named beat
app/beat.1 Traceback (most recent call last):
app/beat.1 File "/app/manage.py", line 30, in <module>
app/beat.1 main()
app/beat.1 ~~~~^^
app/beat.1 File "/app/manage.py", line 26, in main
app/beat.1 execute_from_command_line(sys.argv)
app/beat.1 ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^
app/beat.1 File "/app/.heroku/python/lib/python3.13/site-packages/django/core/management/__init__.py", line 442, in execute_from_command_line
app/beat.1 utility.execute()
app/beat.1 ~~~~~~~~~~~~~~~^^
app/beat.1 File "/app/.heroku/python/lib/python3.13/site-packages/django/core/management/__init__.py", line 436, in execute
app/beat.1 self.fetch_command(subcommand).run_from_argv(self.argv)
app/beat.1 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
app/beat.1 File "/app/.heroku/python/lib/python3.13/site-packages/django_prodserver/management/commands/prodserver.py", line 64, in run_from_argv
app/beat.1 self.start_server(*args, **cmd_options)
app/beat.1 ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
app/beat.1 File "/app/.heroku/python/lib/python3.13/site-packages/django_prodserver/management/commands/prodserver.py", line 102, in start_server
app/beat.1 backend.start_server(*backend.prep_server_args())
app/beat.1 ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/beat.1 File "/app/.heroku/python/lib/python3.13/site-packages/django_prodserver/backends/celery.py", line 26, in start_server
app/beat.1 self.app.Beat(*args).start()
app/beat.1 ^^^^^^^^^^^^^^^^^^^^^^^^^^
app/beat.1 AttributeError: 'Beat' object has no attribute 'start'
app/beat.1 Sentry is attempting to send 2 pending events
app/beat.1 Waiting up to 2 seconds
app/beat.1 Press Ctrl-C to quit
heroku/beat.1 State changed from up to crashed
heroku/beat.1 Process exited with status 1
That might have been due to a change in Celery... ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a project that was possibly erroring like this when trying to add celery with prodserver. Hopefully I'll have time over Christmas to look at this!
Description
django-prodserver is a package to centrally define the production processes to provide an interface to start them via a management command. This PR adds the necessary changes to settings and updates the scripts
Checklist:
Rationale