Skip to content

Commit

Permalink
t
Browse files Browse the repository at this point in the history
  • Loading branch information
muratkaanmesum committed May 8, 2024
1 parent 2e34705 commit 3ce0c37
Show file tree
Hide file tree
Showing 239 changed files with 13 additions and 43,371 deletions.
1 change: 1 addition & 0 deletions API/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
.idea
.env
myenv
/prod_static
# Icon must end with two \r
Icon

Expand Down
47 changes: 10 additions & 37 deletions API/API/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
from dotenv import load_dotenv
import datetime



import Apps.Tournament.apps
from Apps.Profile.logger import CustomisedJSONFormatter

Expand All @@ -28,28 +26,14 @@
# See https://docs.djangoproject.com/en/5.0/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = '0a4fd7e3567eab20bab2f2d6682ea96d0d865050bfcde9c293aa7f9ec48bce55'
SECRET_KEY = os.getenv('SECRET_KEY')

#yeni
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "API.settings")

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True

ALLOWED_HOSTS = ['*']
CSRF_TRUSTED_ORIGINS = [
"http://localhost:3000",
"http://127.0.0.1:3000"
"http://localhost:3030",
]
CORS_ALLOWED_ORIGINS = [
"http://localhost:3000",
"http://127.0.0.1:3000",
"http://localhost:3030",
]
DEBUG = False

CORS_ALLOW_CREDENTIALS = True

ALLOWED_HOSTS = ['*']
INSTALLED_APPS = [
'daphne',
'uvicorn',
Expand All @@ -72,9 +56,7 @@
"Apps.Game.apps.GameConfig",
]


STATIC_URL = '/static/'
APP_ID = 'elk_demo'
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
Expand Down Expand Up @@ -108,17 +90,19 @@
}
}

STATIC_ROOT = Path(BASE_DIR).resolve().joinpath('BASE_DIR', 'static');
STATICFILES_DIRS = []


APP_ID = 'elk_demo'
STATIC_ROOT = Path(BASE_DIR).resolve().joinpath('prod_static');
STATICFILES_DIRS = [
BASE_DIR / "static",
]
MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
"corsheaders.middleware.CorsMiddleware",
"django.middleware.common.CommonMiddleware",
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]

Expand Down Expand Up @@ -158,23 +142,16 @@
'rest_framework_simplejwt.authentication.JWTAuthentication',
),
'DEFAULT_THROTTLE_CLASSES': [

'rest_framework.throttling.AnonRateThrottle',

'rest_framework.throttling.UserRateThrottle'

],
'DEFAULT_THROTTLE_RATES': {

'anon': '50/min',

'user': '100/min'

}
}

STATIC_URL = '/static/'
STATICFILES_DIRS = [BASE_DIR / 'static']

# Database
# https://docs.djangoproject.com/en/5.0/ref/settings/#databases

Expand All @@ -189,7 +166,6 @@
}
}


# Password validation
# https://docs.djangoproject.com/en/5.0/ref/settings/#auth-password-validators

Expand All @@ -208,7 +184,6 @@
},
]


# Internationalization
# https://docs.djangoproject.com/en/5.0/topics/i18n/

Expand All @@ -220,7 +195,6 @@

USE_TZ = True


# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/5.0/howto/static-files/

Expand Down Expand Up @@ -258,7 +232,6 @@
'SLIDING_TOKEN_REFRESH_LIFETIME': datetime.timedelta(days=1),
}


EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_USE_TLS = True
EMAIL_PORT = 587
Expand Down
4 changes: 2 additions & 2 deletions API/Apps/Profile/api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from rest_framework.response import Response
from rest_framework.views import APIView

logger = logging.getLogger(__name__)
#logger = logging.getLogger(__name__)


@authentication_classes([JWTAuthentication])
Expand Down Expand Up @@ -88,7 +88,7 @@ def get(self, request):
return Response({"error": "Profile not found"}, status=404)
stats = profile.stats
serializer = ProfileStatsSerializer(stats)
logger.info('Profile stats retrieved', extra={'profile': profile.nickname})
#logger.info('Profile stats retrieved', extra={'profile': profile.nickname})
return Response(serializer.data, status=200)

def post(self, request, profile_id):
Expand Down
16 changes: 0 additions & 16 deletions API/static/wsgi.py

This file was deleted.

Loading

0 comments on commit 3ce0c37

Please sign in to comment.