Spanish
Estimado Marc, en primer lugar quiero agradecerte el gran tutorial que hiciste y que fue de gran ayuda para comprender como realizar un bot de telegram.
Fui escribiendo el código con cada capítulo y me encontré con el error "bot.models.User.DoesNotExist". Pensé que me equivoqué en algo y cloné el proyecto desde github y me sigue apareciendo el mismo error.
Agradecería cualquier pista para solucionar este inconveniente.
English
Dear Marc, first of all I want to thank you for the great tutorial that you did and that was of great help to understand how to make a telegram bot.
I was writing the code with each chapter and I found the error "bot.models.User.DoesNotExist". I thought I was wrong about something and I cloned the project from github and I keep getting the same error.
I would appreciate any clues to solve this problem.
German
Lieber Marc, zunächst möchte ich dir für das tolle Tutorial danken, das du gemacht hast und das war eine große Hilfe, um zu verstehen, wie man einen Telegramm-Bot erstellt.
Ich habe den Code mit jedem Kapitel geschrieben und den Fehler "bot.models.User.DoesNotExist" gefunden. Ich dachte, ich hätte etwas falsch gemacht und ich habe das Projekt von github geklont und erhalte immer wieder den gleichen Fehler.
Ich würde mich über Hinweise zur Lösung dieses Problems freuen.
**** pip list: ****
pip list
Package Version
aiohttp 3.7.4.post0
asgiref 3.4.1
async-timeout 3.0.1
attrs 21.2.0
chardet 4.0.0
Django 2.1
idna 3.2
idna-ssl 1.1.0
multidict 5.1.0
pip 21.1.3
pytz 2021.1
setuptools 57.0.0
sqlparse 0.4.1
telepot 12.7
typing-extensions 3.10.0.0
urllib3 1.26.6
wheel 0.36.2
yarl 1.6.3
**** terminal *****
Watching for file changes with StatReloader
Performing system checks...
System check identified no issues (0 silenced).
July 08, 2021 - 02:41:32
Django version 3.2.5, using settings 'dtbot.settings'
Starting development server at http://0.0.0.0:8000/
Quit the server with CONTROL-C.
Internal Server Error: /bot/hook/
Traceback (most recent call last):
File "/PRUEBAS/bot_telegram_orig/env/lib/python3.6/site-packages/django/core/handlers/exception.py", line 47, in inner
response = get_response(request)
File "/PRUEBAS/bot_telegram_orig/env/lib/python3.6/site-packages/django/core/handlers/base.py", line 181, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/PRUEBAS/bot_telegram_orig/env/lib/python3.6/site-packages/django/views/decorators/csrf.py", line 54, in wrapped_view
return view_func(*args, **kwargs)
File "/PRUEBAS/bot_telegram_orig/python_telegram_bot/bot/views.py", line 77, in talkin_to_me_bruh
result = _add_message_to_db(json_message)
File "/PRUEBAS/bot_telegram_orig/python_telegram_bot/bot/views.py", line 50, in _add_message_to_db
sender_object = User.objects.filter(user_id__exact=sender_id).get()
File "/PRUEBAS/bot_telegram_orig/env/lib/python3.6/site-packages/django/db/models/query.py", line 437, in get
self.model._meta.object_name
bot.models.User.DoesNotExist: User matching query does not exist.
[08/Jul/2021 02:41:44] "POST /bot/hook/ HTTP/1.1" 500 75305