Skip to main content

A Django app to serve staticfiles using cloudinary

Project description

django-cloudistatic is a Django app to upload your staticfiles to Cloudinary and serve from there. Cloudinary serves files using CDN,which will reduce the load on django server and pages will load faster.

Quick start

  1. Add “djangocloudistatic” to your INSTALLED_APPS setting like this:

    INSTALLED_APPS = [
        ...
        'djangocloudistatic',
    ]
  2. Declare the following settings variables (you will get them from Cloudinary dashboard)

    CLOUDI_NAME = ``Cloud name``
    CLOUDI_API_KEY = ``API Key``
    CLOUDI_API_SECRET = ``API Secret``
  3. Include STATICFILES_DIRS and STATIC_ROOT in settings.py file (Should be included before STATIC_URL) of your project. You may refer to https://docs.djangoproject.com/en/3.2/howto/static-files/ for details.

  4. Modify the STATIC_URL like this:

    STATIC_URL=f'https://res.cloudinary.com/{CLOUDI_NAME}/raw/upload/v1/{STATIC_ROOT}/'
  5. Now run python manage.py collectstatic command to collect all staticfiles to STATIC_ROOT of your project.

  6. Finally, run python manage.py cloudistatic to upload staticfiles to Cloudinary. Wait for a few minutes and your staticfiles will be ready to be served from there. If you want to delete your local STATIC_ROOT (staticfiles will not be served from here now) after uploading to cloud, then you should run python manage.py cloudistatic --deletelocal `` instead of ``python manage.py cloudistatic.

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-cloudistatic-0.1.dev0.tar.gz (4.8 kB view details)

Uploaded Source

File details

Details for the file django-cloudistatic-0.1.dev0.tar.gz.

File metadata

  • Download URL: django-cloudistatic-0.1.dev0.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.3

File hashes

Hashes for django-cloudistatic-0.1.dev0.tar.gz
Algorithm Hash digest
SHA256 b5776b5e749cc4407384fe28ca0e4e5fa0cb13841df71179e98eb1e8949a8740
MD5 f9fcaa7f54258e8d981082513ae7c8fd
BLAKE2b-256 8b277395d84715433cd5daaeb2c5b5a4dffc21b040023273a5ce0b62035e6cc3

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page