Create new chat app, configure urls

This commit is contained in:
Reckless_Satoshi 2022-01-13 03:07:20 -08:00
parent 5df2134fb2
commit f4b14baf69
No known key found for this signature in database
GPG Key ID: 9C4585B561315571
10 changed files with 33 additions and 1 deletions

0
chat/__init__.py Normal file
View File

3
chat/admin.py Normal file
View File

@ -0,0 +1,3 @@
from django.contrib import admin
# Register your models here.

6
chat/apps.py Normal file
View File

@ -0,0 +1,6 @@
from django.apps import AppConfig
class ChatConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'chat'

3
chat/models.py Normal file
View File

@ -0,0 +1,3 @@
from django.db import models
# Create your models here.

3
chat/tests.py Normal file
View File

@ -0,0 +1,3 @@
from django.test import TestCase
# Create your tests here.

8
chat/urls.py Normal file
View File

@ -0,0 +1,8 @@
from django.urls import path
from . import views
urlpatterns = [
path('', views.index, name='index'),
path('<str:order_id>/', views.room, name='room'),
]

3
chat/views.py Normal file
View File

@ -0,0 +1,3 @@
from django.shortcuts import render
# Create your views here.

View File

@ -39,7 +39,9 @@ INSTALLED_APPS = [
'django.contrib.messages',
'django.contrib.staticfiles',
'rest_framework',
'channels',
'api',
'chat',
'frontend.apps.FrontendConfig',
]

View File

@ -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')),
]

View File

@ -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