From c3a2d9c92fca4d420432a10689fba3eaffa98fdf Mon Sep 17 00:00:00 2001 From: kimachinkiy <48508661+kimachinskiy@users.noreply.github.com> Date: Wed, 4 Oct 2023 07:50:26 +0300 Subject: [PATCH] Update --- FrontEnd/nginx.conf | 4 ++-- docker-compose.dev.yml | 4 ++-- forum/settings.py | 12 ++++-------- 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/FrontEnd/nginx.conf b/FrontEnd/nginx.conf index abc61f483..ee5d87bbf 100644 --- a/FrontEnd/nginx.conf +++ b/FrontEnd/nginx.conf @@ -17,12 +17,12 @@ server { location /static/ { autoindex on; - alias /home/forum/app/forum/static/; + alias /home/forum/app/public/static/; } location /media/ { autoindex on; - alias /home/forum/app/forum/medis/; + alias /home/forum/app/public/media/; } # Django Admin diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml index 124265b07..501dc8079 100644 --- a/docker-compose.dev.yml +++ b/docker-compose.dev.yml @@ -8,8 +8,8 @@ services: command: gunicorn forum.wsgi:application --bind 0.0.0.0:8000 volumes: # - ./:/Forum - - static:/forum/static - - media:/forum/media + - static:/home/forum/app/public/static + - media:/home/forum/app/public/media # ports: # - 8000:8000 environment: diff --git a/forum/settings.py b/forum/settings.py index 86ae4b698..9a77aaea1 100644 --- a/forum/settings.py +++ b/forum/settings.py @@ -148,15 +148,11 @@ # Static files (CSS, JavaScript, Images) # https://docs.djangoproject.com/en/4.1/howto/static-files/ -STATICFILES_DIRS =[ - 'forum/static/admin', - 'forum/static/rest_framework', -] -STATIC_URL = 'forum/static/' -STATIC_ROOT = os.path.join(BASE_DIR, 'forum/static/') -MEDIA_URL = os.path.join(BASE_DIR, 'forum/media/') -MEDIA_ROOT = 'forum/media/' +STATIC_URL = 'static/' +STATIC_ROOT = os.path.join(BASE_DIR, 'public/static/') +MEDIA_URL = os.path.join(BASE_DIR, 'public/media/') +MEDIA_ROOT = 'media/' # Default primary key field type # https://docs.djangoproject.com/en/4.1/ref/settings/#default-auto-field