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
Add “djangocloudistatic” to your INSTALLED_APPS setting like this:
INSTALLED_APPS = [ ... 'djangocloudistatic', ]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>
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.
Modify the STATIC_URL like this:
STATIC_URL=f'https://res.cloudinary.com/{CLOUDI_NAME}/raw/upload/v1/{STATIC_ROOT}/'Now run python manage.py collectstatic command to collect all staticfiles to STATIC_ROOT of your project.
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.
For more info check out the documentation. And for questions about usage or development you can create an issue on Github.
Metadata
Release files for django-cloudistatic 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| django-cloudistatic-0.0.1.tar.gz | 4.9 kB | Details |
Release files / django-cloudistatic-0.0.1.tar.gz
| Download URL | django-cloudistatic-0.0.1.tar.gz |
|---|---|
| Size | 4.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
afb6f426e01ab61f9b61d3517b67234e7509f6727a86f5fa166a1b97a29f0b05
|
|
BLAKE2b-256 checksum How to use checksums |
6d77b3d5372b1098e6dda9d82c49119cfc430b264b6ae6073337fc76e27f1696
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|