update de fou

This commit is contained in:
Adrien Audebert
2024-09-17 18:20:33 +02:00
parent 9fe444c65d
commit c9ca99605d
9 changed files with 36 additions and 49 deletions

View File

@@ -14,5 +14,6 @@ urlpatterns = [
path('web3/', views.read_data, name='read_data'),
path('api/match_list/', match_list_json, name='match_list_json'),
path('api/player_list/', player_list_json, name='player_list_json'),
path('api/tournoi_list/', tournoi_list_json, name='tournoi_list_json')
path('api/tournoi_list/', tournoi_list_json, name='tournoi_list_json'),
path('trigger-error/', views.trigger_error)
]

View File

@@ -9,10 +9,14 @@ from django.contrib.auth.models import User
from django.contrib.auth import authenticate
from django.views.decorators.csrf import csrf_exempt
from rest_framework import viewsets
from django.http import HttpResponse
import json
import uuid
def trigger_error(request):
raise ValueError("This is a test error to generate a 500 response.")
def index(request):
return render(request, 'index.html')
@@ -172,4 +176,4 @@ def write_data(request):
# # Attente de la confirmation de la transaction
# tx_receipt = web3.eth.wait_for_transaction_receipt(tx_hash)
# print("Transaction receipt:", tx_receipt)
print("-----------------------------")
print("-----------------------------")

View File

@@ -22,8 +22,13 @@ SECRET_KEY = '12345678'
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
ALLOWED_HOSTS = ['*']
ALLOWED_HOSTS = [
'www.ft-transcendence.com',
'ft-transcendence.com',
'localhost',
'127.0.0.1']
USE_X_FORWARDED_HOST = True
# Application definition
@@ -137,32 +142,6 @@ CHANNEL_LAYERS = {
},
}
LOGGING = {
'version': 1, # Django requires this key
'disable_existing_loggers': False, # Keep Django's default loggers
'formatters': {
'simple': {
'format': '{levelname} {message}',
'style': '{', # Allows to use Python's new style string formatting
},
},
'handlers': {
'console': { # Log to the console
'level': 'DEBUG', # Minimum level of messages that should be handled
'class': 'logging.StreamHandler',
'formatter': 'simple', # Use the simple formatter defined above
},
},
'loggers': {
'django': { # The main logger for Django itself
'handlers': ['console'],
'level': 'DEBUG', # Minimum log level to be logged
'propagate': False, # Prevents log propagation to other loggers
},
},
}
"""
LOGGING = {
'version': 1, # The version of the logging configuration schema
'disable_existing_loggers': False, # Allows existing loggers to keep logging
@@ -193,8 +172,7 @@ LOGGING = {
'django': { # The Django logger catches all messages sent by the Django framework
'handlers': ['file', 'console'], # Sends logs to both the file and the console
'level': 'DEBUG', # Minimum log level to be logged
'propagate': True, # If True, messages will be passed to the parent loggers as well
'propagate': False, # If True, messages will be passed to the parent loggers as well
},
},
}
"""