From 3b2f8aee309ce853992de021302af8dbd65c2726 Mon Sep 17 00:00:00 2001 From: Chneemann Date: Tue, 22 Apr 2025 10:42:15 +0200 Subject: [PATCH] chore: remove django_debug_toolbar and update ALLOWED_HOSTS and CORS settings --- backend/requirements.txt | 1 - backend/videoflix/settings.py | 8 +++----- backend/videoflix/urls.py | 3 +-- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/backend/requirements.txt b/backend/requirements.txt index dbee599..85afc18 100644 --- a/backend/requirements.txt +++ b/backend/requirements.txt @@ -5,7 +5,6 @@ click==8.1.7 diff-match-patch==20230430 Django==5.0.8 django-cors-headers==4.4.0 -django-debug-toolbar==4.4.6 django-grip==3.5.0 django-import-export==4.1.1 django-redis==5.4.0 diff --git a/backend/videoflix/settings.py b/backend/videoflix/settings.py index 49b0e82..db6811b 100644 --- a/backend/videoflix/settings.py +++ b/backend/videoflix/settings.py @@ -38,7 +38,7 @@ EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' DEFAULT_FROM_EMAIL = 'noreply@videoflix.com' ALLOWED_HOSTS = [ - 'videoflix-django.andre-kempf.com', + 'videoflix-api.andre-kempf.com', '45.157.177.172', 'localhost', '127.0.0.1', @@ -51,7 +51,7 @@ CORS_ALLOWED_ORIGINS = [ ] CSRF_TRUSTED_ORIGINS = [ - 'https://videoflix-django.andre-kempf.com', + 'https://videoflix-api.andre-kempf.com', ] # Application definition @@ -65,7 +65,6 @@ INSTALLED_APPS = [ 'rest_framework.authtoken', 'rest_framework', 'corsheaders', - 'debug_toolbar', 'django_rq', 'import_export', 'user_app', @@ -73,7 +72,7 @@ INSTALLED_APPS = [ ] MIDDLEWARE = [ - 'debug_toolbar.middleware.DebugToolbarMiddleware', + 'corsheaders.middleware.CorsMiddleware', 'django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', @@ -81,7 +80,6 @@ MIDDLEWARE = [ 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', - 'corsheaders.middleware.CorsMiddleware', ] ROOT_URLCONF = 'videoflix.urls' diff --git a/backend/videoflix/urls.py b/backend/videoflix/urls.py index 0220a40..d52b664 100644 --- a/backend/videoflix/urls.py +++ b/backend/videoflix/urls.py @@ -29,7 +29,6 @@ from auth_app.views import ( ChangePasswordView ) from video_app import views as video_views -from debug_toolbar.toolbar import debug_toolbar_urls from django.contrib.staticfiles.urls import staticfiles_urlpatterns urlpatterns = [ @@ -55,4 +54,4 @@ urlpatterns = [ path('auth/verify-email/', VerifyEmailView.as_view(), name='verify_email'), path('auth/forgot-password/', ForgotPasswordView.as_view(), name='forgot_password'), path('auth/change-password/', ChangePasswordView.as_view(), name='change_password'), -] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) + debug_toolbar_urls() + staticfiles_urlpatterns() \ No newline at end of file +] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) + staticfiles_urlpatterns() \ No newline at end of file