File tree Expand file tree Collapse file tree 3 files changed +6
-19
lines changed
Expand file tree Collapse file tree 3 files changed +6
-19
lines changed Original file line number Diff line number Diff line change @@ -19,10 +19,14 @@ pip install -r requirements.txt
1919db.sqlite3
2020```
2121
22- #### Add PostgreSQL db
22+ #### Add PostgreSQL db (discomment the code in settings.py)
2323
2424``` bash
25- db.sqlite3
25+ LOCAL_DB_NAME=db-name
26+ LOCAL_DB_USER=
27+ LOCAL_DB_PASSWORD=
28+ LOCAL_DB_HOST=127.0.0.1
29+ LOCAL_DB_PORT=5432
2630```
2731
2832#### Migrate models
Original file line number Diff line number Diff line change 22from django .utils import timezone
33from django .db import models
44from django .contrib .auth .models import AbstractBaseUser , PermissionsMixin
5- from model_utils import Choices
65from .managers import CustomUserManager
76
87
Original file line number Diff line number Diff line change 99
1010import os
1111
12- from channels .routing import ProtocolTypeRouter , URLRouter
1312from django .core .asgi import get_asgi_application
14- from django .urls import path , include
15-
16- from api .consumer import ChatConsumer
17- from channels .auth import AuthMiddlewareStack
1813
1914os .environ .setdefault ('DJANGO_SETTINGS_MODULE' , 'service.settings' )
2015
2116django_asgi_app = get_asgi_application ()
22-
23- application = ProtocolTypeRouter ({
24- "http" : django_asgi_app ,
25- # Just HTTP for now. (We can add other protocols later.)
26- "websocket" : AuthMiddlewareStack (
27- URLRouter (
28- #[path('ws/match/', MatchConsumer.as_asgi())]
29- [path ('ws/chat/<str:room_name>/' , ChatConsumer .as_asgi ())]
30- )
31- )
32- })
You can’t perform that action at this time.
0 commit comments