Skip to content

Commit

Permalink
* Added settings for static and media files
Browse files Browse the repository at this point in the history
* Updated .gitignore
  • Loading branch information
ProDG committed Sep 27, 2023
1 parent 52b4465 commit a0c6d6d
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,7 @@
/.DS_Store
__pycache__/
/FrontEnd/node_modules

public/*
!public/media/.gitkeep
!public/static/.gitkeep
8 changes: 7 additions & 1 deletion forum/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down
Empty file added public/media/.gitkeep
Empty file.
Empty file added public/static/.gitkeep
Empty file.

0 comments on commit a0c6d6d

Please sign in to comment.