Django-Compressor cannot find files when it is actually there

I just installed django-compressor for my project and I am getting below error message.

TemplateSyntaxError at / Caught UncompressableFileError while rendering: 'js / jquery-1.7.2.min.js' could not be found in COMPRESS_ROOT '/ Users / taelimoh / Dropbox / gluwagit / static' or with staticfiles.

This also happens when I try to compress css files.

Of course, there are files, and it works fine when I don't try to compress them using django-compress.

below is my template

... {% compress js %} <!--Javascripts--> <!--Libraries--> <script type="text/javascript" src="/static/js/jquery-1.7.2.min.js"></script> {% endcompress %} ... 

and these are my .py settings

 COMPRESS_ENABLED = True STATICFILES_FINDERS = ( 'django.contrib.staticfiles.finders.FileSystemFinder', 'django.contrib.staticfiles.finders.AppDirectoriesFinder', 'compressor.finders.CompressorFinder', ) INSTALLED_APPS = ( 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.messages', 'django.contrib.staticfiles', 'django.contrib.admin', 'django.contrib.admindocs', 'django.contrib.humanize', ############################################## 'appconf',# required by django-compressor 'versiontools',# required by django-compressor 'compressor',#https://github.com/jezdez/django_compressor ... ) 

I use the google engine and my django version is 1.3. The problem was released on my development server.

+4
source share
2 answers

It may be a little late, but the documentation states that all files configured with a static handler in your app.yaml cannot be read by the application. Fortunately, there is also a switch that allows your application to read these files. You can read about it here . Essentially you would like to do that

 handlers: - url: /static - static_dir: staticfiles - application_readable: true 

in app.yaml (note application_readable ). For some time I struggled with this because os.path.exists always failed. Hope this helps.

+2
source

GAE applications do not have write permissions to files. If the Django compressor tries to write compressed files to the file system, this will fail.

0
source

Source: https://habr.com/ru/post/1438323/


All Articles