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
85. return self.cursor.execute(sql, params)
File "C:\Users\Starlord\Dev\ChatApp2\lib\site-packages\django\db\backends\sqlite3\base.py" in execute
303. return Database.Cursor.execute(self, query, params)
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
35. response = get_response(request)
File "C:\Users\Starlord\Dev\ChatApp2\lib\site-packages\django\core\handlers\base.py" in _get_response
128. response = self.process_exception_by_middleware(e, request)
File "C:\Users\Starlord\Dev\ChatApp2\lib\site-packages\django\core\handlers\base.py" in _get_response
126. response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "C:\Users\Starlord\Dev\ChatApp2\DRF-Chat\chat\views.py" in message_view
96. Message.objects.filter(sender_id=receiver, receiver_id=sender)})
File "C:\Users\Starlord\Dev\ChatApp2\lib\site-packages\django\shortcuts.py" in render
36. content = loader.render_to_string(template_name, context, request, using=using)
File "C:\Users\Starlord\Dev\ChatApp2\lib\site-packages\django\template\loader.py" in render_to_string
62. return template.render(context, request)
File "C:\Users\Starlord\Dev\ChatApp2\lib\site-packages\django\template\backends\django.py" in render
61. return self.template.render(context)
File "C:\Users\Starlord\Dev\ChatApp2\lib\site-packages\django\template\base.py" in render
175. return self._render(context)
File "C:\Users\Starlord\Dev\ChatApp2\lib\site-packages\django\template\base.py" in _render
167. return self.nodelist.render(context)
File "C:\Users\Starlord\Dev\ChatApp2\lib\site-packages\django\template\base.py" in render
943. bit = node.render_annotated(context)
File "C:\Users\Starlord\Dev\ChatApp2\lib\site-packages\django\template\base.py" in render_annotated
910. return self.render(context)
File "C:\Users\Starlord\Dev\ChatApp2\lib\site-packages\django\template\loader_tags.py" in render
155. return compiled_parent._render(context)
File "C:\Users\Starlord\Dev\ChatApp2\lib\site-packages\django\template\base.py" in _render
167. return self.nodelist.render(context)
File "C:\Users\Starlord\Dev\ChatApp2\lib\site-packages\django\template\base.py" in render
943. bit = node.render_annotated(context)
File "C:\Users\Starlord\Dev\ChatApp2\lib\site-packages\django\template\base.py" in render_annotated
910. return self.render(context)
File "C:\Users\Starlord\Dev\ChatApp2\lib\site-packages\django\template\loader_tags.py" in render
155. return compiled_parent._render(context)
File "C:\Users\Starlord\Dev\ChatApp2\lib\site-packages\django\template\base.py" in _render
167. return self.nodelist.render(context)
File "C:\Users\Starlord\Dev\ChatApp2\lib\site-packages\django\template\base.py" in render
943. bit = node.render_annotated(context)
File "C:\Users\Starlord\Dev\ChatApp2\lib\site-packages\django\template\base.py" in render_annotated
910. return self.render(context)
File "C:\Users\Starlord\Dev\ChatApp2\lib\site-packages\django\template\loader_tags.py" in render
67. result = block.nodelist.render(context)
File "C:\Users\Starlord\Dev\ChatApp2\lib\site-packages\django\template\base.py" in render
943. bit = node.render_annotated(context)
File "C:\Users\Starlord\Dev\ChatApp2\lib\site-packages\django\template\base.py" in render_annotated
910. return self.render(context)
File "C:\Users\Starlord\Dev\ChatApp2\lib\site-packages\django\template\loader_tags.py" in render
67. result = block.nodelist.render(context)
File "C:\Users\Starlord\Dev\ChatApp2\lib\site-packages\django\template\base.py" in render
943. bit = node.render_annotated(context)
File "C:\Users\Starlord\Dev\ChatApp2\lib\site-packages\django\template\base.py" in render_annotated
910. return self.render(context)
File "C:\Users\Starlord\Dev\ChatApp2\lib\site-packages\django\template\defaulttags.py" in render
168. len_values = len(values)
File "C:\Users\Starlord\Dev\ChatApp2\lib\site-packages\django\db\models\query.py" in len
254. self._fetch_all()
File "C:\Users\Starlord\Dev\ChatApp2\lib\site-packages\django\db\models\query.py" in _fetch_all
1179. self._result_cache = list(self._iterable_class(self))
File "C:\Users\Starlord\Dev\ChatApp2\lib\site-packages\django\db\models\query.py" in iter
54. results = compiler.execute_sql(chunked_fetch=self.chunked_fetch, chunk_size=self.chunk_size)
File "C:\Users\Starlord\Dev\ChatApp2\lib\site-packages\django\db\models\sql\compiler.py" in execute_sql
1063. cursor.execute(sql, params)
File "C:\Users\Starlord\Dev\ChatApp2\lib\site-packages\django\db\backends\utils.py" in execute
100. return super().execute(sql, params)
File "C:\Users\Starlord\Dev\ChatApp2\lib\site-packages\django\db\backends\utils.py" in execute
68. return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
File "C:\Users\Starlord\Dev\ChatApp2\lib\site-packages\django\db\backends\utils.py" in _execute_with_wrappers
77. return executor(sql, params, many, context)
File "C:\Users\Starlord\Dev\ChatApp2\lib\site-packages\django\db\backends\utils.py" in _execute
85. return self.cursor.execute(sql, params)
File "C:\Users\Starlord\Dev\ChatApp2\lib\site-packages\django\db\utils.py" in exit
89. raise dj_exc_value.with_traceback(traceback) from exc_value
File "C:\Users\Starlord\Dev\ChatApp2\lib\site-packages\django\db\backends\utils.py" in _execute
85. return self.cursor.execute(sql, params)
File "C:\Users\Starlord\Dev\ChatApp2\lib\site-packages\django\db\backends\sqlite3\base.py" in execute
303. return Database.Cursor.execute(self, query, params)
Exception Type: OperationalError at /chat/2/1
Exception Value: no such table: chat_message