Skip to main content

Simple project to copy media files (intended for fixtures loads), pretty much as Django staticfiles does

Project description

Build Status Coverage PyPI Version Python Versions License


Simple project to copy media files (intended for fixtures loads), pretty much as staticfiles does.


  • Python 3.5+
  • Django 1.8+

Note: The version (v1.x.x) dropped support of Python2! If you still need Python2, please check the last version of v0.1.x series


pip install django-media-fixtures==1.0.0

Then, put ‘django_media_fixtures’ on your INSTALLED_APPS (on, just below ‘django.contrib.staticfiles’.


Just call manage command ‘collectmedia’, same as you do with collectstatic:

python collectmedia

And then all files on ‘media_fixtures’ folder in-apps will be copied to your MEDIA_ROOT.

So, when you create your fixture (for any ways, even through shell), put your file path matching the same tree folder view as your media file.

For instance,


Where the file ‘example.jpg’ is on: yourappfolder/media_fixtures/uploads/yourmodel/img/example.jpg



    You can change the media fixtures folder’s name on your apps, just putting this variable on


    You can change the media fixtures finders, to search media files on other folders not in-app, for instance.

            'django_media_fixtures.finders.FileSystemFinder',      # combined with MEDIA_FIXTURES_FILES_DIRS, choose specific folders
            'django_media_fixtures.finders.AppDirectoriesFinder',  # default (if you do not set MEDIA_FIXTURES_FILES_FINDERS)

    You can list specific media folders that you want to include on search.


Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-media-fixtures-1.0.0.tar.gz (13.5 kB view hashes)

Uploaded source

Built Distribution

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page