bpeschier / django-compressor-requirejs Goto Github PK
View Code? Open in Web Editor NEWCompress requirejs-modules into bundles.
License: MIT License
Compress requirejs-modules into bundles.
License: MIT License
Would be nice if it actually compresses the bundles O:)
Hi,
Using Django 1.9.4 on Python 3.4.3 there is an error when trying to use this app.
Unhandled exception in thread started by <function check_errors.<locals>.wrapper at 0x7f3975404b70>
Traceback (most recent call last):
File "/.../VirtualEnv/lib/python3.4/site-packages/django/utils/autoreload.py", line 226, in wrapper
fn(*args, **kwargs)
File "/.../VirtualEnv/lib/python3.4/site-packages/django/core/management/commands/runserver.py", line 109, in inner_run
autoreload.raise_last_exception()
File "/.../VirtualEnv/lib/python3.4/site-packages/django/utils/autoreload.py", line 249, in raise_last_exception
six.reraise(*_exception)
File "/.../VirtualEnv/lib/python3.4/site-packages/django/utils/six.py", line 685, in reraise
raise value.with_traceback(tb)
File "/.../VirtualEnv/lib/python3.4/site-packages/django/utils/autoreload.py", line 226, in wrapper
fn(*args, **kwargs)
File "/.../VirtualEnv/lib/python3.4/site-packages/django/__init__.py", line 18, in setup
apps.populate(settings.INSTALLED_APPS)
File "/.../VirtualEnv/lib/python3.4/site-packages/django/apps/registry.py", line 85, in populate
app_config = AppConfig.create(entry)
File "/.../VirtualEnv/lib/python3.4/site-packages/django/apps/config.py", line 90, in create
module = import_module(entry)
File "/.../VirtualEnv/lib/python3.4/importlib/__init__.py", line 109, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 2254, in _gcd_import
File "<frozen importlib._bootstrap>", line 2237, in _find_and_load
File "<frozen importlib._bootstrap>", line 2226, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 1200, in _load_unlocked
File "<frozen importlib._bootstrap>", line 1129, in _exec
File "<frozen importlib._bootstrap>", line 1471, in exec_module
File "<frozen importlib._bootstrap>", line 321, in _call_with_frames_removed
File "/.../VirtualEnv/lib/python3.4/site-packages/requirejs/__init__.py", line 1, in <module>
from .filter import RequireJSCompiler
File "/.../VirtualEnv/lib/python3.4/site-packages/requirejs/filter.py", line 19, in <module>
from .js import JsCompressor
File "/.../VirtualEnv/lib/python3.4/site-packages/requirejs/js.py", line 5, in <module>
from compressor.js import JsCompressor as CompressorJsCompressor
File "/.../VirtualEnv/lib/python3.4/site-packages/compressor/js.py", line 2, in <module>
from compressor.base import Compressor, SOURCE_HUNK, SOURCE_FILE
File "/.../VirtualEnv/lib/python3.4/site-packages/compressor/base.py", line 19, in <module>
from compressor.utils import get_class, get_mod_func, staticfiles
File "/.../VirtualEnv/lib/python3.4/site-packages/compressor/utils/staticfiles.py", line 9, in <module>
if apps.is_installed("django.contrib.staticfiles"):
File "/.../VirtualEnv/lib/python3.4/site-packages/django/apps/registry.py", line 227, in is_installed
self.check_apps_ready()
File "/.../VirtualEnv/lib/python3.4/site-packages/django/apps/registry.py", line 124, in check_apps_ready
raise AppRegistryNotReady("Apps aren't loaded yet.")
django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet.
A simple workaround for this is to move the import from .js import JsCompressor
into the function write_output
.
Currently only 0.3 is available. The settings since have changed so it would be great to have the current version pushed to PyPi.
require([a, b
// , c
])
trips the conversion into a list of dependencies.
jQuery and Masonry set their own module names in a complete define(, [], function(...) { ... }) call. This requires a paths
setting if the module is not on that path.
Currently the compressor filter labels these modules under their full path, instead of recognising the module has its name preset.
Hey,
I'm using Django 1.8.3 with Python 3.4.3, and I have the following error when trying to use your module:
>>> import requirejs
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "/.../venv/lib/python3.4/site-packages/requirejs/__init__.py", line 1, in <module>
from .filter import RequireJSCompiler
File "/.../venv/lib/python3.4/site-packages/requirejs/filter.py", line 8, in <module>
from django.template.loaders.app_directories import app_template_dirs
ImportError: cannot import name 'app_template_dirs'
It seems that app_template_dirs
is indeed not there:
>>> from django.template.loaders.app_directories import app_template_dirs
Traceback (most recent call last):
File "<input>", line 1, in <module>
ImportError: cannot import name 'app_template_dirs'
django.template.loaders.app_directories
has a get_app_template_dirs
function.
Could you please fix this?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.