diff --git a/Reskreen/settings.py b/Reskreen/settings.py index eb89a83..8e4b8fe 100644 --- a/Reskreen/settings.py +++ b/Reskreen/settings.py @@ -30,6 +30,7 @@ DEBUG = cfg_dev_mode ALLOWED_HOSTS = ["rh.ambulance-clerc.ch"] if cfg_dev_mode: ALLOWED_HOSTS.append("127.0.0.1") + ALLOWED_HOSTS.append("33.144.144.2") CSRF_TRUSTED_ORIGINS = ['https://rh.ambulance-clerc.ch'] @@ -56,6 +57,8 @@ INSTALLED_APPS = [ ] INSTALLED_APPS += ( 'apilog.apps.ApilogConfig',) +INSTALLED_APPS += ( 'corsheaders',) +'', #Ajout de rest_framework INSTALLED_APPS += ('rest_framework', 'rest_framework.authtoken',) @@ -116,6 +119,7 @@ DATA_UPLOAD_MAX_NUMBER_FIELDS = 2500 MIDDLEWARE = [ + 'corsheaders.middleware.CorsMiddleware', 'django.middleware.security.SecurityMiddleware', 'whitenoise.middleware.WhiteNoiseMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', @@ -129,8 +133,13 @@ MIDDLEWARE = [ 'django.middleware.locale.LocaleMiddleware', ] +CORS_ALLOWED_ORIGINS = [ + "http://33.144.144.2:5173", # Ajoutez ici l'URL de votre application frontend , +] + MIDDLEWARE += ('apilog.middleware.APILogMiddleware',) + ROOT_URLCONF = 'Reskreen.urls' TEMPLATES = [ diff --git a/db.sqlite3 b/db.sqlite3 new file mode 100644 index 0000000..2bd120e Binary files /dev/null and b/db.sqlite3 differ