diff --git a/chat/__init__.py b/chat/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/chat/admin.py b/chat/admin.py new file mode 100644 index 00000000..8c38f3f3 --- /dev/null +++ b/chat/admin.py @@ -0,0 +1,3 @@ +from django.contrib import admin + +# Register your models here. diff --git a/chat/apps.py b/chat/apps.py new file mode 100644 index 00000000..2fe899ad --- /dev/null +++ b/chat/apps.py @@ -0,0 +1,6 @@ +from django.apps import AppConfig + + +class ChatConfig(AppConfig): + default_auto_field = 'django.db.models.BigAutoField' + name = 'chat' diff --git a/chat/models.py b/chat/models.py new file mode 100644 index 00000000..71a83623 --- /dev/null +++ b/chat/models.py @@ -0,0 +1,3 @@ +from django.db import models + +# Create your models here. diff --git a/chat/tests.py b/chat/tests.py new file mode 100644 index 00000000..7ce503c2 --- /dev/null +++ b/chat/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/chat/urls.py b/chat/urls.py new file mode 100644 index 00000000..688d1735 --- /dev/null +++ b/chat/urls.py @@ -0,0 +1,8 @@ +from django.urls import path + +from . import views + +urlpatterns = [ + path('', views.index, name='index'), + path('/', views.room, name='room'), +] \ No newline at end of file diff --git a/chat/views.py b/chat/views.py new file mode 100644 index 00000000..91ea44a2 --- /dev/null +++ b/chat/views.py @@ -0,0 +1,3 @@ +from django.shortcuts import render + +# Create your views here. diff --git a/robosats/settings.py b/robosats/settings.py index 4e8946aa..1b88f379 100644 --- a/robosats/settings.py +++ b/robosats/settings.py @@ -39,7 +39,9 @@ INSTALLED_APPS = [ 'django.contrib.messages', 'django.contrib.staticfiles', 'rest_framework', + 'channels', 'api', + 'chat', 'frontend.apps.FrontendConfig', ] diff --git a/robosats/urls.py b/robosats/urls.py index b84599cc..eb7315bd 100644 --- a/robosats/urls.py +++ b/robosats/urls.py @@ -19,5 +19,6 @@ from django.urls import path, include urlpatterns = [ path('admin/', admin.site.urls), path('api/', include('api.urls')), - path('', include('frontend.urls')) + path('chat/', include('chat.urls')), + path('', include('frontend.urls')), ] diff --git a/setup.md b/setup.md index 7a206f0e..de13568f 100644 --- a/setup.md +++ b/setup.md @@ -33,6 +33,9 @@ source /usr/local/bin/virtualenvwrapper.sh ## Install Django admin relational links `pip install django-admin-relation-links` +## Install Django channels for websockets +`pip install channels` + *Django 4.0 at the time of writting* ### Launch the local development node