Skip to content

Commit

Permalink
Fix static files settings.py
Browse files Browse the repository at this point in the history
  • Loading branch information
matiasvallejosdev committed Feb 13, 2024
1 parent f25127f commit 27c32e1
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions todo_project/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,15 +152,12 @@

# This setting tells Django at which URL static files are going to be served to the user.
# Here, they will be accessible at your-domain.onrender.com/static/...
STATIC_URL = "/static/"
MEDIA_URL = "/images/"
STATIC_URL = "static/"
MEDIA_URL = "images/"

STATICFILES_DIRS = [os.path.join(BASE_DIR, "static")]

if not DEBUG: # Tell Django to copy statics to the `staticfiles` directory
STATIC_ROOT = os.path.join(BASE_DIR, "staticfiles_build", "static")
MEDIA_ROOT = os.path.join(BASE_DIR, "staticfiles_build", "images")
STATICFILES_STORAGE = "whitenoise.storage.CompressedManifestStaticFilesStorage"
STATICFILES_DIRS = os.path.join(BASE_DIR, "static")
STATIC_ROOT = os.path.join(BASE_DIR, "staticfiles_build", "static")
MEDIA_ROOT = os.path.join(BASE_DIR, "staticfiles_build", "images")

# Default primary key field type
# https://docs.djangoproject.com/en/4.0/ref/settings/#default-auto-field
Expand Down

0 comments on commit 27c32e1

Please sign in to comment.