0

What is the difference between static files and media files? Django says that the SATIC_ROOT and MEDIA_ROOT must be different. I just know that in static folder we can have css files and images or other files to be uploaded goes to media folder. I have directory as

static

|-->images

|-->css

in settings.py >>

STATIC_URL = 'static/'

STATICFILES_DIRS = [ BASE_DIR / 'static' ]

MEDIA_URL = '/images/'

MEDIA_ROOT = os.path.join(BASE_DIR, 'static/images')


Is the ROOT and URL for static and media files are okay or not?

1 Answers1

0
  • MEDIA_ROOT is the folder where files uploaded using FileField will go.

  • STATIC_ROOT is the folder where static files will be stored after using manage.py collectstatic

  • We generally use STATIC_ROOT in production

Tariq Ahmed
  • 471
  • 3
  • 14