Skip to content

Commit

Permalink
added channel for chat to app
Browse files Browse the repository at this point in the history
  • Loading branch information
walosha committed Jan 30, 2023
1 parent 5bdd6c6 commit ac1fdc7
Show file tree
Hide file tree
Showing 15 changed files with 45 additions and 7 deletions.
7 changes: 7 additions & 0 deletions .env.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
CLOUDINARY_CLOUD_NAME=
CLOUDINARY_API_KEY=
CLOUDINARY_API_SECRET=
DATABASE_URL=
GOOGLE_SERVICE_ACCOUNT=
CALENDER_ID=
SECRET_KEY=
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,8 @@ church-375900-fbd978c352ca.json
new.json
old.json
.env.prod
data
data
# Elastic Beanstalk Files
.elasticbeanstalk/*
!.elasticbeanstalk/*.cfg.yml
!.elasticbeanstalk/*.global.yml
Empty file added church/channel/__init__.py
Empty file.
3 changes: 3 additions & 0 deletions church/channel/admin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.contrib import admin

# Register your models here.
6 changes: 6 additions & 0 deletions church/channel/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from django.apps import AppConfig


class ChannelConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'channel'
Empty file.
3 changes: 3 additions & 0 deletions church/channel/models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.db import models

# Create your models here.
3 changes: 3 additions & 0 deletions church/channel/tests.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.test import TestCase

# Create your tests here.
3 changes: 3 additions & 0 deletions church/channel/views.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.shortcuts import render

# Create your views here.
7 changes: 6 additions & 1 deletion church/core/asgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@
import os
# from channels.security.websocket import AllowedHostsOriginValidator
from django.core.asgi import get_asgi_application
from channels.routing import ProtocolTypeRouter

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'core.settings')

application = get_asgi_application()
django_asgi_app = get_asgi_application()

application = ProtocolTypeRouter({
'http': django_asgi_app,
})
2 changes: 2 additions & 0 deletions church/core/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

# SECURITY WARNING: keep the secret key used in production secret!

ASGI_APPLICATION = 'core.routing.application'

# Application definition
TAGGIT_CASE_INSENSITIVE = True
Expand All @@ -42,6 +43,7 @@
'rest_framework.authtoken',
'rest_framework_simplejwt.token_blacklist',
'import_export',
'channels',
'django_filters',
'taggit',
"account",
Expand Down
1 change: 0 additions & 1 deletion church/daphne.sock.lock

This file was deleted.

7 changes: 5 additions & 2 deletions config/nginx/default.conf.template
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,18 @@ upstream daphne {

server {
listen 80;
server_name www.church.com church.com;
# server_name www.church.com church.com;
server_name localhost;

return 301 https://$host$request_uri;
}
server {

listen 443 ssl;
ssl_certificate /code/church/ssl/church.crt;
ssl_certificate_key /code/church/ssl/church.key;
server_name www.church.com church.com;
# server_name www.church.com church.com;
server_name localhost;
error_log stderr warn;
access_log /dev/stdout main;

Expand Down
3 changes: 1 addition & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
@@ Access swagger documentation on : api/doc/#/

`
docker-compose exec web python manage.py migrate

docker compose exec web python /code/church/manage.py migrate
docker compose exec web python /code/church/manage.py collectstatic
or
python manage.py collectstatic --settings=church.settings.local
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ uwsgi==2.0.20
daphne==3.0.2
uwsgi==2.0.20
python-dateutil==1.4
channels==3.0.5

0 comments on commit ac1fdc7

Please sign in to comment.