Publishing question 419
Posting to X: 'We just published a new question! Follow us on Bluesky @cppquiz.bsky.social or Mastodon @cppquiz@mastodon.online for updates. For obvious reasons, no longer post to Elon Musk's X.'
Traceback (most recent call last):
File "/home/dh_8p7d44/sites/[cppquiz.org/cppquiz/manage.py](http://cppquiz.org/cppquiz/manage.py)", line 10, in <module>
execute_from_command_line(sys.argv)
~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^
File "/home/dh_8p7d44/sites/[cppquiz.org/venv/lib/python3.13/site-packages/django/core/management/__init__.py](http://cppquiz.org/venv/lib/python3.13/site-packages/django/core/management/__init__.py)", line 442, in execute_from_command_line
utility.execute()
~~~~~~~~~~~~~~~^^
File "/home/dh_8p7d44/sites/[cppquiz.org/venv/lib/python3.13/site-packages/django/core/management/__init__.py](http://cppquiz.org/venv/lib/python3.13/site-packages/django/core/management/__init__.py)", line 436, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
File "/home/dh_8p7d44/sites/[cppquiz.org/venv/lib/python3.13/site-packages/django/core/management/base.py](http://cppquiz.org/venv/lib/python3.13/site-packages/django/core/management/base.py)", line 420, in run_from_argv
self.execute(*args, **cmd_options)
~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
File "/home/dh_8p7d44/sites/[cppquiz.org/venv/lib/python3.13/site-packages/django/core/management/base.py](http://cppquiz.org/venv/lib/python3.13/site-packages/django/core/management/base.py)", line 464, in execute
output = self.handle(*args, **options)
File "/home/dh_8p7d44/sites/[cppquiz.org/cppquiz/quiz/management/commands/auto_publish.py](http://cppquiz.org/cppquiz/quiz/management/commands/auto_publish.py)", line 31, in handle
self.post_to_x()
~~~~~~~~~~~~~~^^
File "/home/dh_8p7d44/sites/[cppquiz.org/cppquiz/quiz/management/commands/auto_publish.py](http://cppquiz.org/cppquiz/quiz/management/commands/auto_publish.py)", line 44, in post_to_x
response = client.create_tweet(
text=content
)
File "/home/dh_8p7d44/sites/[cppquiz.org/venv/lib/python3.13/site-packages/tweepy/client.py](http://cppquiz.org/venv/lib/python3.13/site-packages/tweepy/client.py)", line 845, in create_tweet
return self._make_request(
~~~~~~~~~~~~~~~~~~^
"POST", f"/2/tweets", json=json, user_auth=user_auth
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/home/dh_8p7d44/sites/[cppquiz.org/venv/lib/python3.13/site-packages/tweepy/client.py](http://cppquiz.org/venv/lib/python3.13/site-packages/tweepy/client.py)", line 129, in _make_request
response = self.request(method, route, params=request_params,
json=json, user_auth=user_auth)
File "/home/dh_8p7d44/sites/[cppquiz.org/venv/lib/python3.13/site-packages/tweepy/client.py](http://cppquiz.org/venv/lib/python3.13/site-packages/tweepy/client.py)", line 100, in request
raise Forbidden(response)
tweepy.errors.Forbidden: 403 Forbidden
When authenticating requests to the Twitter API v2 endpoints, you must use keys and tokens from a Twitter developer App that is attached to a Project. You can create a project via the developer portal.
Just got this error:
Edit, fixed:
We_ should also make sure an error in one of these posting functions inquiz/management/commands/auto_publish.pydoesn't stop the other ones from being called.