We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent defe950 commit 37b9748Copy full SHA for 37b9748
1 file changed
server/api/settings.py
@@ -149,7 +149,10 @@
149
MEDIA_ROOT = BASE_DIR/"media"
150
151
# The url to serve images and other media
152
-MEDIA_URL = "http://localhost:8000/media/"
+if DEBUG:
153
+ MEDIA_URL = "http://localhost:8000/media/"
154
+else:
155
+ MEDIA_URL = f"https://{ALLOWED_HOSTS[0]}/media/"
156
157
DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField"
158
0 commit comments