Skip to main content

Default static path for Django ImageField

Project description

Default static file path for Django ImageField


  • install it via pip install django-default-imagefield

  • add it to your settings and it auto-registers itself

    settings.INSTALLED_APPS = [


  • add field to your model class

    from django_fields import DefaultStaticImageField
    class Post(models.Model):
      photo = DefaultStaticImageField(blank=True)
  • default path is django_fields/no_image.png and is included in the package. you can change it via

    DEFAULT_IMAGE_PATH = 'images/custom_no_image.png'
  • or add field attribute default_image_path

    class Post(models.Model):
      photo = DefaultStaticImageField(blank=True, default_image_path='images/blank.png')
  • if there is no file in the default_image_path of the field or DEFAULT_IMAGE_PATH in, use the default image built into the package.

  • if deploying to a production environment, you must run the ./ collectstatic command to copy the image files included in the package to the static file serving path.


As an open source project, we welcome contributions.

The code lives on github.

Project details

Download files

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

Files for django-default-imagefield, version 0.5.5
Filename, size File type Python version Upload date Hashes
Filename, size django-default-imagefield-0.5.5.tar.gz (27.2 kB) File type Source Python version None Upload date Hashes View

Supported by

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