Closed NightHawk451 closed 6 years ago
I copied your project, pipped the requirements and ran it as is. I made two users. When one user tries to chat with the other (they click on the new user) you get the following error message:
Environment:
Request Method: GET Request URL: http://127.0.0.1:8000/chat/2/1
Django Version: 2.0 Python Version: 3.6.4 Installed Applications: ['django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'widget_tweaks', 'rest_framework', 'chat'] Installed Middleware: ['django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware']
Template error: In template C:\Users\Starlord\Dev\ChatApp2\DRF-Chat\templates\chat\index.html, error at line 0 no such table: chat_message 1 : {% load staticfiles %} 2 : <!DOCTYPE html> 3 : <html> 4 : <head> 5 : <!--Import Google Icon Font--> 6 : <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"> 7 : <!--Import materialize.css--> 8 : <link type="text/css" rel="stylesheet" href="{% static 'css/materialize.min.css' %}" media="screen,projection"/> 9 : <link type="text/css" rel="stylesheet" href="{% static 'css/style.css' %}" media="screen,projection"/> 10 :
Traceback:
File "C:\Users\Starlord\Dev\ChatApp2\lib\site-packages\django\db\backends\utils.py" in _execute
File "C:\Users\Starlord\Dev\ChatApp2\lib\site-packages\django\db\backends\sqlite3\base.py" in execute
The above exception (no such table: chat_message) was the direct cause of the following exception:
File "C:\Users\Starlord\Dev\ChatApp2\lib\site-packages\django\core\handlers\exception.py" in inner
File "C:\Users\Starlord\Dev\ChatApp2\lib\site-packages\django\core\handlers\base.py" in _get_response
File "C:\Users\Starlord\Dev\ChatApp2\DRF-Chat\chat\views.py" in message_view
File "C:\Users\Starlord\Dev\ChatApp2\lib\site-packages\django\shortcuts.py" in render
File "C:\Users\Starlord\Dev\ChatApp2\lib\site-packages\django\template\loader.py" in render_to_string
File "C:\Users\Starlord\Dev\ChatApp2\lib\site-packages\django\template\backends\django.py" in render
File "C:\Users\Starlord\Dev\ChatApp2\lib\site-packages\django\template\base.py" in render
File "C:\Users\Starlord\Dev\ChatApp2\lib\site-packages\django\template\base.py" in _render
File "C:\Users\Starlord\Dev\ChatApp2\lib\site-packages\django\template\base.py" in render_annotated
File "C:\Users\Starlord\Dev\ChatApp2\lib\site-packages\django\template\loader_tags.py" in render
File "C:\Users\Starlord\Dev\ChatApp2\lib\site-packages\django\template\defaulttags.py" in render
File "C:\Users\Starlord\Dev\ChatApp2\lib\site-packages\django\db\models\query.py" in len
File "C:\Users\Starlord\Dev\ChatApp2\lib\site-packages\django\db\models\query.py" in _fetch_all
File "C:\Users\Starlord\Dev\ChatApp2\lib\site-packages\django\db\models\query.py" in iter
File "C:\Users\Starlord\Dev\ChatApp2\lib\site-packages\django\db\models\sql\compiler.py" in execute_sql
File "C:\Users\Starlord\Dev\ChatApp2\lib\site-packages\django\db\backends\utils.py" in execute
File "C:\Users\Starlord\Dev\ChatApp2\lib\site-packages\django\db\backends\utils.py" in _execute_with_wrappers
File "C:\Users\Starlord\Dev\ChatApp2\lib\site-packages\django\db\utils.py" in exit
Exception Type: OperationalError at /chat/2/1 Exception Value: no such table: chat_message
The above can be fixed with the below code:
python manage.py migrate --run-syncdb
I copied your project, pipped the requirements and ran it as is. I made two users. When one user tries to chat with the other (they click on the new user) you get the following error message:
Environment:
Request Method: GET Request URL: http://127.0.0.1:8000/chat/2/1
Django Version: 2.0 Python Version: 3.6.4 Installed Applications: ['django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'widget_tweaks', 'rest_framework', 'chat'] Installed Middleware: ['django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware']
Traceback:
File "C:\Users\Starlord\Dev\ChatApp2\lib\site-packages\django\db\backends\utils.py" in _execute
File "C:\Users\Starlord\Dev\ChatApp2\lib\site-packages\django\db\backends\sqlite3\base.py" in execute
The above exception (no such table: chat_message) was the direct cause of the following exception:
File "C:\Users\Starlord\Dev\ChatApp2\lib\site-packages\django\core\handlers\exception.py" in inner
File "C:\Users\Starlord\Dev\ChatApp2\lib\site-packages\django\core\handlers\base.py" in _get_response
File "C:\Users\Starlord\Dev\ChatApp2\lib\site-packages\django\core\handlers\base.py" in _get_response
File "C:\Users\Starlord\Dev\ChatApp2\DRF-Chat\chat\views.py" in message_view
File "C:\Users\Starlord\Dev\ChatApp2\lib\site-packages\django\shortcuts.py" in render
File "C:\Users\Starlord\Dev\ChatApp2\lib\site-packages\django\template\loader.py" in render_to_string
File "C:\Users\Starlord\Dev\ChatApp2\lib\site-packages\django\template\backends\django.py" in render
File "C:\Users\Starlord\Dev\ChatApp2\lib\site-packages\django\template\base.py" in render
File "C:\Users\Starlord\Dev\ChatApp2\lib\site-packages\django\template\base.py" in _render
File "C:\Users\Starlord\Dev\ChatApp2\lib\site-packages\django\template\base.py" in render
File "C:\Users\Starlord\Dev\ChatApp2\lib\site-packages\django\template\base.py" in render_annotated
File "C:\Users\Starlord\Dev\ChatApp2\lib\site-packages\django\template\loader_tags.py" in render
File "C:\Users\Starlord\Dev\ChatApp2\lib\site-packages\django\template\base.py" in _render
File "C:\Users\Starlord\Dev\ChatApp2\lib\site-packages\django\template\base.py" in render
File "C:\Users\Starlord\Dev\ChatApp2\lib\site-packages\django\template\base.py" in render_annotated
File "C:\Users\Starlord\Dev\ChatApp2\lib\site-packages\django\template\loader_tags.py" in render
File "C:\Users\Starlord\Dev\ChatApp2\lib\site-packages\django\template\base.py" in _render
File "C:\Users\Starlord\Dev\ChatApp2\lib\site-packages\django\template\base.py" in render
File "C:\Users\Starlord\Dev\ChatApp2\lib\site-packages\django\template\base.py" in render_annotated
File "C:\Users\Starlord\Dev\ChatApp2\lib\site-packages\django\template\loader_tags.py" in render
File "C:\Users\Starlord\Dev\ChatApp2\lib\site-packages\django\template\base.py" in render
File "C:\Users\Starlord\Dev\ChatApp2\lib\site-packages\django\template\base.py" in render_annotated
File "C:\Users\Starlord\Dev\ChatApp2\lib\site-packages\django\template\loader_tags.py" in render
File "C:\Users\Starlord\Dev\ChatApp2\lib\site-packages\django\template\base.py" in render
File "C:\Users\Starlord\Dev\ChatApp2\lib\site-packages\django\template\base.py" in render_annotated
File "C:\Users\Starlord\Dev\ChatApp2\lib\site-packages\django\template\defaulttags.py" in render
File "C:\Users\Starlord\Dev\ChatApp2\lib\site-packages\django\db\models\query.py" in len
File "C:\Users\Starlord\Dev\ChatApp2\lib\site-packages\django\db\models\query.py" in _fetch_all
File "C:\Users\Starlord\Dev\ChatApp2\lib\site-packages\django\db\models\query.py" in iter
File "C:\Users\Starlord\Dev\ChatApp2\lib\site-packages\django\db\models\sql\compiler.py" in execute_sql
File "C:\Users\Starlord\Dev\ChatApp2\lib\site-packages\django\db\backends\utils.py" in execute
File "C:\Users\Starlord\Dev\ChatApp2\lib\site-packages\django\db\backends\utils.py" in execute
File "C:\Users\Starlord\Dev\ChatApp2\lib\site-packages\django\db\backends\utils.py" in _execute_with_wrappers
File "C:\Users\Starlord\Dev\ChatApp2\lib\site-packages\django\db\backends\utils.py" in _execute
File "C:\Users\Starlord\Dev\ChatApp2\lib\site-packages\django\db\utils.py" in exit
File "C:\Users\Starlord\Dev\ChatApp2\lib\site-packages\django\db\backends\utils.py" in _execute
File "C:\Users\Starlord\Dev\ChatApp2\lib\site-packages\django\db\backends\sqlite3\base.py" in execute
Exception Type: OperationalError at /chat/2/1 Exception Value: no such table: chat_message