Skip to content

Commit f440d08

Browse files
committed
fix: value for MEDIA_URL for uploaded files
1 parent 59a6b18 commit f440d08

4 files changed

Lines changed: 4 additions & 1 deletion

File tree

server/.env.development.sample

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
DEBUG=True
22
SECRET_KEY=i!c#ilronu_o_g7@!tpvz9@94o2gkami5xkf3kytbgw1^#qt68
33
DATABASE_URL=sqlite:///server/db.sqlite3
4+
MEDIA_URL=/media/
45
MEDIA_ROOT=server/uploads
56

67
USE_LOCAL_FILE_STORAGE=True

server/.env.example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ SECRET_KEY=i!c#ilronu_o_g7@!tpvz9@94o2gkami5xkf3kytbgw1^#qt68
66
DATABASE_URL=sqlite:///db.sqlite3
77

88
# Storage Configuration
9+
MEDIA_URL=/media/ # URL prefix for serving media files
910
MEDIA_ROOT=uploads # Path to store uploaded media files
1011
USE_LOCAL_FILE_STORAGE=False # Set to True to use local file system storage instead of R2
1112

server/.env.production.sample

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
DEBUG=False
22
SECRET_KEY=i!c#ilronu_o_g7@!tpvz9@94o2gkami5xkf3kytbgw1^#qt68
33
DATABASE_URL=sqlite:////data/db.sqlite3
4+
MEDIA_URL=/media/uploads/
45
MEDIA_ROOT=/data/media/uploads
56

67
USE_LOCAL_FILE_STORAGE=False

server/config/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ def create_log_dir_for_server_errors():
322322
AWS_QUERYSTRING_AUTH = False # Don't add complex authentication-related query parameters to URLs
323323

324324
# Media files configuration
325-
MEDIA_URL = '/media/'
325+
MEDIA_URL = env.str('MEDIA_URL', default='/media/')
326326
MEDIA_ROOT = env.str('MEDIA_ROOT', default=os.path.join(BASE_DIR, 'uploads'))
327327

328328
# Storage backend configuration

0 commit comments

Comments
 (0)