[go: nahoru, domu]

Skip to content

Commit

Permalink
trying to debug websocket connections
Browse files Browse the repository at this point in the history
  • Loading branch information
mohsen-ameli committed Jun 3, 2023
1 parent e534fcd commit 7b04611
Show file tree
Hide file tree
Showing 4 changed files with 76 additions and 30 deletions.
14 changes: 8 additions & 6 deletions backend/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -128,12 +128,14 @@ Control.ca-bundle
Control.system-ca-bundle
GitHub.sublime-settings

# Visual Studio Code #
# .vscode/*
# !.vscode/settings.json
# !.vscode/tasks.json
# !.vscode/launch.json
# !.vscode/extensions.json
# Visual Studio Code
.vscode/*
.vscode/settings.json
.vscode
# !.vscode/settings.json
# !.vscode/tasks.json
# !.vscode/launch.json
# !.vscode/extensions.json
.history

*.rdb
Expand Down
25 changes: 24 additions & 1 deletion backend/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,30 @@
{
"peacock.remoteColor": "#ff774d",
"files.exclude": {
"**/.git": false,
"**/.svn": false,
"**/.hg": false,
"**/CVS": false,
"**/.DS_Store": false,
"**/Thumbs.db": false,
"runtime.txt": false,
"requirements.txt": false,
"Procfile": false,
"dump.rdb": false,
"db.sqlite3": false,
"**/.gitignore": false,
"**/venv": false,
"venv": false,
"**/.vscode": false,
".vscode": false,
"**/static": false,
"static": false,
"manage.py": false,
".gitignore": false,
"__pycache__": false,
"migrations": false
},
"explorerExclude.backup": {
"**/.git": false,
"**/.svn": false,
"**/.hg": false,
Expand All @@ -24,7 +48,6 @@
"__pycache__": true,
"migrations": true
},
"explorerExclude.backup": {},
"workbench.colorCustomizations": {
"activityBar.activeBackground": "#ff9e80",
"activityBar.background": "#ff9e80",
Expand Down
41 changes: 19 additions & 22 deletions backend/backend/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

SECRET_KEY = os.environ.get("SECRET_KEY")

DEBUG = str(os.environ.get("DEBUG")) == "1"
DEBUG = True # str(os.environ.get("DEBUG")) == "1"

ALLOWED_HOSTS = [
"backend.3dbackgammon.com",
Expand Down Expand Up @@ -84,7 +84,7 @@
"default": {
"BACKEND": "channels_redis.core.RedisChannelLayer",
"CONFIG": {
"hosts": [("127.0.0.1", 6379)] if DEBUG else [os.environ.get("REDIS_URL")],
"hosts": [os.environ.get("REDIS_URL")] # [("127.0.0.1", 6379)] if DEBUG else [os.environ.get("REDIS_URL")],
},
},
}
Expand All @@ -93,24 +93,24 @@
# Database
# https://docs.djangoproject.com/en/4.1/ref/settings/#databases

if DEBUG:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': BASE_DIR / 'db.sqlite3',
}
}
else:
DATABASES = {
"default": {
"ENGINE": "django.db.backends.postgresql_psycopg2",
"NAME": os.environ.get("PGDATABASE"),
"USER": os.environ.get("PGUSER"),
"PASSWORD": os.environ.get("PGPASSWORD"),
"HOST": os.environ.get("PGHOST"),
"PORT": os.environ.get("PGPORT"),
}
# if DEBUG:
# DATABASES = {
# 'default': {
# 'ENGINE': 'django.db.backends.sqlite3',
# 'NAME': BASE_DIR / 'db.sqlite3',
# }
# }
# else:
DATABASES = {
"default": {
"ENGINE": "django.db.backends.postgresql_psycopg2",
"NAME": os.environ.get("PGDATABASE"),
"USER": os.environ.get("PGUSER"),
"PASSWORD": os.environ.get("PGPASSWORD"),
"HOST": os.environ.get("PGHOST"),
"PORT": os.environ.get("PGPORT"),
}
}

# Password validation
# https://docs.djangoproject.com/en/4.1/ref/settings/#auth-password-validators
Expand All @@ -132,9 +132,6 @@

AUTH_USER_MODEL = 'users.CustomUser'

# The interval at which the client will receive updates (in seconds)
UPDATE_INTERVAL = DEBUG and 1 or 2

# User turn duration (Synced with frontend in Data.ts)
USER_TURN_DURATION = 70

Expand Down
26 changes: 25 additions & 1 deletion frontend/.vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,31 @@
"typescript.tsdk": "node_modules/typescript/lib",
"typescript.enablePromptUseWorkspaceTsdk": true,
"files.exclude": {
"**/.git": false,
"**/.svn": false,
"**/.hg": false,
"**/CVS": false,
"**/.DS_Store": false,
"**/Thumbs.db": false,
".vscode": false,
".next": false,
"node_modules": false,
"tsconfig.json": false,
"yarn.lock": false,
"sandbox.config.json": false,
"README.md": false,
"postcss.config.js": false,
"next-env.d.ts": false,
"LICENSE": false,
".prettierrc": false,
".prettierignore": false,
".gitignore": false,
".eslintrc": false,
".eslintignore": false,
".editorconfig": false,
"tailwind.config.js": false
},
"explorerExclude.backup": {
"**/.git": true,
"**/.svn": true,
"**/.hg": true,
Expand All @@ -37,7 +62,6 @@
".editorconfig": true,
"tailwind.config.js": true
},
"explorerExclude.backup": {},
"workbench.colorCustomizations": {
"activityBar.activeBackground": "#93e6fc",
"activityBar.background": "#93e6fc",
Expand Down

0 comments on commit 7b04611

Please sign in to comment.