0PricingLogin
Django Academy · Lesson

MEDIA_ROOT and File Uploads

Accept and store user-uploaded files.

Static vs Media

Static files ship with your code. Media files are uploaded by your users at runtime, like avatars or documents, and they need their own home.

The MEDIA_ROOT Setting

MEDIA_ROOT is the absolute folder on disk where Django saves every uploaded file. It lives outside your source code tree.

MEDIA_ROOT = BASE_DIR / 'media'

All lessons in this course

  1. STATICFILES and the static Tag
  2. collectstatic for Production
  3. MEDIA_ROOT and File Uploads
  4. ImageField and Serving Uploads
← Back to Django Academy