-
-
Notifications
You must be signed in to change notification settings - Fork 156
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c98a151
commit a20333e
Showing
10 changed files
with
1,119 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
release: python manage.py migrate --noinput | ||
web: gunicorn blt.wsgi --log-file - --workers 2 --worker-class gthread --threads 2 --timeout 120 | ||
web: uvicorn blt.asgi:application --host 0.0.0.0 --port 8000 --workers 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# asgi.py | ||
|
||
import os | ||
|
||
import django | ||
|
||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "blt.settings") | ||
django.setup() | ||
|
||
from channels.auth import AuthMiddlewareStack | ||
from channels.routing import ProtocolTypeRouter, URLRouter | ||
from django.core.asgi import get_asgi_application | ||
from django.urls import path | ||
|
||
from website import consumers # You will define a consumer for handling WebSockets | ||
|
||
application = ProtocolTypeRouter( | ||
{ | ||
"http": get_asgi_application(), | ||
"websocket": AuthMiddlewareStack( | ||
URLRouter( | ||
[ | ||
path("ws/similarity/", consumers.SimilarityConsumer.as_asgi()), # WebSocket URL | ||
] | ||
) | ||
), | ||
} | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.