diff --git a/.gitignore b/.gitignore index d9c46cded..052304a10 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,7 @@ /.DS_Store __pycache__/ /FrontEnd/node_modules + +public/* +!public/media/.gitkeep +!public/static/.gitkeep diff --git a/forum/settings.py b/forum/settings.py index a77ab13fe..4bf1fd08c 100644 --- a/forum/settings.py +++ b/forum/settings.py @@ -9,6 +9,7 @@ For the full list of settings and their values, see https://docs.djangoproject.com/en/4.1/ref/settings/ """ +import os from datetime import timedelta from pathlib import Path @@ -147,7 +148,12 @@ # Static files (CSS, JavaScript, Images) # https://docs.djangoproject.com/en/4.1/howto/static-files/ -STATIC_URL = 'static/' +STATIC_URL = '/static/' +STATIC_ROOT = os.path.join(BASE_DIR, 'public', 'static') + +MEDIA_URL = '/media/' +MEDIA_ROOT = os.path.join(BASE_DIR, 'public', 'media') + # Default primary key field type # https://docs.djangoproject.com/en/4.1/ref/settings/#default-auto-field diff --git a/public/media/.gitkeep b/public/media/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/public/static/.gitkeep b/public/static/.gitkeep new file mode 100644 index 000000000..e69de29bb