Django preventing the loading of django

I am using django-compressor with a remote site on an Ubuntu server.

In my local environment, I'm on Windows, where django-compressor doesn't work.

Therefore I can't load django-compressor in my installed apps in my development settings (I have a settings folder with a base.py with dev.py and prod.py inheriting from that).

The problem is in my base.html template where I need to load the compress module

{% load compress %}

at the top of the document, and of course compress my css and js files accordingly.

Clearly this doesn't work on my local environment, with DEBUG set to True because the app can't exist in my installed apps. What I am trying to do is prevent this app being loaded dependent on the value of settings.DEBUG. I have tried an assignment tag which returns settings.DEBUG but that doesn't work.

Is this possible to achieve?

Many thanks in advance.


check out https://pypi.python.org/pypi/django-friendly-tag-loader/.

However, in theory django-compressor should work under windows, although it is not tested and might be broken at the moment. you could find out what the problem is and open a bug report or fix the issue.

链接地址: http://www.djcxy.com/p/68524.html

上一篇: 如何做一个GitHub拉取请求

下一篇: Django防止加载Django